Answers.Body: <p>The trouble is, there's no one way to utilize AWS. You can set up a simple VPS, or get endlessly complicated with load-balancing multiple servers, adding CDN, utilizing cool caching options, and plenty more.</p>
  
  <p>I've been fortunate enough to learn a lot from a siteops team that established all the infrastructure. It's a bit much for getting started, but the result was a combination of Route 53 for DNS, Elastic Beanstalk+Docker+EC2 for server instances, S3 for Asset sources, CloudFront for easy CDN, RDS for MySQL, and Elasticache for Redis session storage. Craft happily worked with all these things out of the box, after some trial and error. The goal wasn't to have a single server running, but discrete components that could be scaled for stability and demand.</p>
  
  <p>But that's a horrendous place to get started. While I need to write a blog post about what I've learned AWS-wise, you can get started more simply by following <a href="http://coenraets.org/blog/2012/01/setting-up-wordpress-on-amazon-ec2-in-5-minutes/" rel="noreferrer">a tutorial for another LAMP app like WordPress</a> since most of the setup's going to be the same. If you're comfortable with Linux, or comfortable Googling your way through various tweaks, this should be a breeze. <strong>Just pretend the AWS control panel isn't hilariously daunting and you'll be fine.</strong></p>
  
  <p>If you're looking to be a Craft-AWS pro, you could experiment in steps:</p>
  
  <h2>Level 1: Get Craft running on a single EC2 instance</h2>
  
  <p>All the stuff on one box, conceptually identical to Digital Ocean or Linode or whatever. I like Ubuntu 14.04 because I'm most familiar with it, but you can pick a Linux distribution, make sure the requirements are in place, give Craft a poke, and triumphantly point a domain name to your EC2 IP.</p>
  
  <p>Solspace have created <a href="https://solspace.com/blog/spinning-up-a-craft-cms-development-site-on-amazon-ec2" rel="noreferrer">a detailed guide</a> for this.</p>
  
  <h2>Level 2: Sprinkle in AWS components</h2>
  
  <p>This will prove that adding AWS services needn't be hard. You can easily...</p>
  
  <ol>
  <li><a href="https://craftcms.stackexchange.com/questions/9800/how-to-set-up-cloudfront-for-a-craft-site">Add CDN with CloudFront</a></li>
  <li>Move MySQL off of your VPS and use RDS instead</li>
  <li>Use Elasticache for Redis, and store PHP's sessions there by installing an extension and adding two lines to php.ini (<code>session.save_handler = redis</code> and <code>session.save_path = tcp://your-aws-cache-url:6379</code>)</li>
  <li>Use Route 53 for DNS, because why not</li>
  </ol>
  
  <h2>Level 3: Automate deployments and use multiple server instances</h2>
  
  <p>This is where I start to gloss over: set up Docker images and Elastic Beanstalk for automated deployments, and add multiple EC2 server instances with load balancers (and <a href="http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html" rel="noreferrer">sticky sessions</a>!) that spread out traffic. You've theoretically got many of your pieces in place after level 2, so if you can master level 3 you'll basically have your undergraduate degree in AWS.</p>
  
  <hr>
  
  <p><em>Edit May 29, 2020</em></p>
  
  <p>While it isn’t AWS-specific, there’s a Knowledge Base article with tips for configuring Craft for multi-server environments: <a href="https://craftcms.com/knowledge-base/configuring-load-balanced-environments" rel="noreferrer">https://craftcms.com/knowledge-base/configuring-load-balanced-environments</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-15T21:47:23.490Z
Answers.Text: "Just pretend the AWS control panel isn't hilariously daunting and you'll be fine." I lol'd.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-15T21:52:23.657Z
Answers.Text: And yet no upvote? Way to hoard the points, @BradBell.
Answers.UserDisplayName: Matt Stein
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-15T21:53:21.320Z
Answers.Text: I like to make people beg for their points.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-15T21:54:40.060Z
Answers.Text: That's fair, I guess.
Answers.UserDisplayName: Matt Stein
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2015-10-15T21:39:27.580Z
Answers.LastActivityDate: 2020-05-29T15:19:52.823Z
Answers.LastEditDate: 2020-05-29T15:19:52.823Z
Answers.UserDisplayName: Matt Stein
Answers.Body: <p>I was able to deploy Craft CMS to an AWS Lightsail + LAMP instance roughly following the <a href="https://craftcms.com/docs/4.x/installation.html" rel="nofollow noreferrer">installation documentation</a> with the following steps:</p>
  <ol>
  <li>Create a new instance using LAMP (PHP8)</li>
  <li>Create a new database using MySQL</li>
  <li>Upload CraftCMS via SFTP to /opt/bitnami/apache/htdocs/ or use composer</li>
  <li>Change instance root directory to /opt/bitnami/apache/htdocs/web to use default .htaccess from CraftCMS (Root directory is set by the file at /opt/bitnami/apache/conf/bitnami/bitnami.conf and bitnami-ssl.conf for SSL) (web is a folder within the CraftCMS install in case you uploaded to .../htdocs/craftcms/ )</li>
  <li>Files/directories mentioned in <a href="https://craftcms.com/docs/4.x/installation.html#step-2-set-the-file-permissions" rel="nofollow noreferrer">Step 2 in the installation doc</a> need to have change ownership (sudo chown) set to bitnami:daemon (this needs a sudo command) and change mod (chmod) to 774 (install guide recommended testing 744 first but nosplash for me)</li>
  <li>Access https://[Hostname]/index.php?p=admin/install to run first time install. Note: If this fails, reupload the file /opt/bitnami/apache/htdocs/.env with its default file</li>
  <li>Enter database credentials from the database created in step 2. Note: Endpoint = Server. Database name = most likely database username minus user (dbmasteruser -&gt; dbmaster)</li>
  </ol>
  <p>I haven't run into any issues so far with this set up though some various tweaks need to be committed to address warnings visible within the system.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-12T22:56:55.550Z
Answers.Text: Note: The default AWS database password gen has symbols that will cause Craft DB's connection to fail — change the database to a simpler password. `A-Z0-9%*` appear to be fine but @ will definitely cause it to fail.
Answers.UserDisplayName: franklylately
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-18T12:25:12.757Z
Answers.Text: Does anyone have a copy of the permissions in step 2? The page has been updated
Answers.UserDisplayName: Jaytrix
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-21T01:50:18.277Z
Answers.Text: @Jaytrix jump on the discord or try to look up a past version of the page using wayback machine. I’ll annotate my answer when I get on a desktop
Answers.UserDisplayName: franklylately
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-23T14:49:05.520Z
Answers.Text: I meant to reply with the link I found that may well be the permissions (https://craftcms.com/docs/3.x/installation.html#step-2-set-the-file-permissions). Unfortunately I didn't get much luck in the end so scraped the site and going to try again. It seemed like a battle of permissions between CLI and the web.
Answers.UserDisplayName: Jaytrix
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-30T11:40:16.800Z
Answers.Text: Anyone looking to do the same themselves - I'll do a writeup of how I got it working and share here
Answers.UserDisplayName: Jaytrix
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-16T16:00:37.407Z
Answers.LastActivityDate: 2022-12-01T19:59:54.647Z
Answers.LastEditDate: 2022-12-01T19:59:54.647Z
Answers.UserDisplayName: franklylately
Body: <p>I made my first Craft site with MAMP locally. I am trying to get my site running on AWS but I'm having a hard time with understanding the process.
  Are there any good tutorials or suggestions about how to deploy it? </p>
  
Tags: <deployment><hosting><aws>
Title: Deploying Craft on AWS
ThreadText: # Deploying Craft on AWS
  
  (Asked by: username_0 on 2015-10-11)
  
  I made my first Craft site with MAMP locally. I am trying to get my site running on AWS but I'm having a hard time with understanding the process.
  Are there any good tutorials or suggestions about how to deploy it?
  
  **Tags:** deployment, hosting, aws
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-10-15. Score: 29
  
  The trouble is, there's no one way to utilize AWS. You can set up a simple VPS, or get endlessly complicated with load-balancing multiple servers, adding CDN, utilizing cool caching options, and plenty more.
  
  I've been fortunate enough to learn a lot from a siteops team that established all the infrastructure. It's a bit much for getting started, but the result was a combination of Route 53 for DNS, Elastic Beanstalk+Docker+EC2 for server instances, S3 for Asset sources, CloudFront for easy CDN, RDS for MySQL, and Elasticache for Redis session storage. Craft happily worked with all these things out of the box, after some trial and error. The goal wasn't to have a single server running, but discrete components that could be scaled for stability and demand.
  
  But that's a horrendous place to get started. While I need to write a blog post about what I've learned AWS-wise, you can get started more simply by following [a tutorial for another LAMP app like WordPress](http://coenraets.org/blog/2012/01/setting-up-wordpress-on-amazon-ec2-in-5-minutes/) since most of the setup's going to be the same. If you're comfortable with Linux, or comfortable Googling your way through various tweaks, this should be a breeze. **Just pretend the AWS control panel isn't hilariously daunting and you'll be fine.**
  
  If you're looking to be a Craft-AWS pro, you could experiment in steps:
  
  ## Level 1: Get Craft running on a single EC2 instance
  
  All the stuff on one box, conceptually identical to Digital Ocean or Linode or whatever. I like Ubuntu 14.04 because I'm most familiar with it, but you can pick a Linux distribution, make sure the requirements are in place, give Craft a poke, and triumphantly point a domain name to your EC2 IP.
  
  Solspace have created [a detailed guide](https://solspace.com/blog/spinning-up-a-craft-cms-development-site-on-amazon-ec2) for this.
  
  ## Level 2: Sprinkle in AWS components
  
  This will prove that adding AWS services needn't be hard. You can easily...
  
  1. [Add CDN with CloudFront](https://craftcms.stackexchange.com/questions/9800/how-to-set-up-cloudfront-for-a-craft-site)
  2. Move MySQL off of your VPS and use RDS instead
  3. Use Elasticache for Redis, and store PHP's sessions there by installing an extension and adding two lines to php.ini (`session.save_handler = redis` and `session.save_path = tcp://your-aws-cache-url:6379`)
  4. Use Route 53 for DNS, because why not
  
  ## Level 3: Automate deployments and use multiple server instances
  
  This is where I start to gloss over: set up Docker images and Elastic Beanstalk for automated deployments, and add multiple EC2 server instances with load balancers (and [sticky sessions](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html)!) that spread out traffic. You've theoretically got many of your pieces in place after level 2, so if you can master level 3 you'll basically have your undergraduate degree in AWS.
  
  ---
  
  *Edit May 29, 2020*
  
  While it isn’t AWS-specific, there’s a Knowledge Base article with tips for configuring Craft for multi-server environments: <https://craftcms.com/knowledge-base/configuring-load-balanced-environments>
  
  > **Comments:**
  > **username_2**: "Just pretend the AWS control panel isn't hilariously daunting and you'll be fine." I lol'd.  
  > **username_1**: And yet no upvote? Way to hoard the points, @username_2.  
  > **username_2**: I like to make people beg for their points.  
  > **username_1**: That's fair, I guess.  
  
  ---
  
  ### Answer by username_3 on 2022-11-16. Score: 1
  
  I was able to deploy Craft CMS to an AWS Lightsail + LAMP instance roughly following the [installation documentation](https://craftcms.com/docs/4.x/installation.html) with the following steps:
  
  1. Create a new instance using LAMP (PHP8)
  2. Create a new database using MySQL
  3. Upload CraftCMS via SFTP to /opt/bitnami/apache/htdocs/ or use composer
  4. Change instance root directory to /opt/bitnami/apache/htdocs/web to use default .htaccess from CraftCMS (Root directory is set by the file at /opt/bitnami/apache/conf/bitnami/bitnami.conf and bitnami-ssl.conf for SSL) (web is a folder within the CraftCMS install in case you uploaded to .../htdocs/craftcms/ )
  5. Files/directories mentioned in [Step 2 in the installation doc](https://craftcms.com/docs/4.x/installation.html#step-2-set-the-file-permissions) need to have change ownership (sudo chown) set to bitnami:daemon (this needs a sudo command) and change mod (chmod) to 774 (install guide recommended testing 744 first but nosplash for me)
  6. Access https://[Hostname]/index.php?p=admin/install to run first time install. Note: If this fails, reupload the file /opt/bitnami/apache/htdocs/.env with its default file
  7. Enter database credentials from the database created in step 2. Note: Endpoint = Server. Database name = most likely database username minus user (dbmasteruser -> dbmaster)
  
  I haven't run into any issues so far with this set up though some various tweaks need to be committed to address warnings visible within the system.
  
  > **Comments:**
  > **username_3**: Note: The default AWS database password gen has symbols that will cause Craft DB's connection to fail — change the database to a simpler password. `A-Z0-9%*` appear to be fine but @ will definitely cause it to fail.  
  > **username_4**: Does anyone have a copy of the permissions in step 2? The page has been updated  
  > **username_3**: @username_4 jump on the discord or try to look up a past version of the page using wayback machine. I’ll annotate my answer when I get on a desktop  
  > **username_4**: I meant to reply with the link I found that may well be the permissions (https://craftcms.com/docs/3.x/installation.html#step-2-set-the-file-permissions). Unfortunately I didn't get much luck in the end so scraped the site and going to try again. It seemed like a battle of permissions between CLI and the web.  
  > **username_4**: Anyone looking to do the same themselves - I'll do a writeup of how I got it working and share here  
  
  ---
  
  