This post will detail my notes from the steps I used for a new project to get WordPress up and running on AWS Lightsail.
References:
- Setting up WordPress on Lightsail Properly by Michael Wood
- Quick start guide: WordPress on Amazon Lightsail by AWS
- Getting the application user name and password for your ‘Certified by Bitnami’ instance in Amazon Lightsail by AWS
Purchase the Domain Name using Route53
Every great project must start with a new domain name… I will use AWS Route53.
- Log into the AWS Console.
- Navigate to the Route 53 service.
- Check for and Register domain.
- Find the perfect domain name, check availability, and purchase.
- It can take a bit for the request to be processed, up to 3 days, but normally it is fairly quick. Be sure to confirm the email, which validates your email address.
- Now that you have your new domain name, you are fully committed to completing the project!
Deploy the Lightsail Instance
- On the AWS console, navigate to the Lightsail service.
- Click Create Instance
- Select defaults platform: Linux/Unix, and blueprint: WordPress
- This will install the WordPress Certified by Bitnami and Automattic 5.9.2-3 (at the time of this post) configuration.
- Change SSH key pair, or use the default suggested.
- Choose the instance plan. The smallest is sufficient for a lightly used site ($3.50 / month, 512 MB, 1 vCPU, 20 GB SSD, 1 TB Transfer).
- Identify your instance: Select an instance name
- Add any tags if desired.
- Click Create instance.
Create a Static IP
- Select the option to Add a Static IP, otherwise your public IP address will change when the instance is stopped / started.
- Attach the Static IP to your new instance.
Point Domain Name to the Static IP
- In Route 53, select the hosted zone for your new domain name.
- Click Create record.
- Record name – add a www prefix, for example, if desired.
- Record type – A record (default)
- Value – paste in the public IP address for your Elastic IP
- TTL seconds – 300 (default)
- Routing policy – Simple Routing (default)
- Click Create record.
- Create additional A records for other prefixes, for example: www or blog, if needed.
- It will take a moment for the records to propagate and become active.
Connect to your Instance
- Connect to your instance using ssh with the key saved earlier, or use the console to connect. The user name is bitnami. The example below is connecting from a linux bash shell.
chmod 400 your-lightsail-key.pem
ssh -i your-lightsail-key.pem bitnami@your-static-ip
- When first logging in, a message was displayed that locales were not installed.
sudo apt-get install locales-all
Set up Encryption
We will be using Let’s Encrypt to serve your website using HTTPS.
sudo /opt/bintami/bncert-tool
Adjustments to wp-config.php
sudo vi /opt/bitnami/wp-config.php
#Change the WP_SITEURL and WP_HOME to reflect your domain name with https.
Adjustments to php.ini
sudo vi /opt/bitnami/php/etc/php.ini
# Change the:
# upload_max_filesize = 150M
# post_max_size = 150M
# Increase (if desired...
# I left it at the default 30 without any issue so far)
# max_execution_time = 300
Get the bitnami user password
cd
cat bitnami_application_password
Sign in to your site
- Open a browser tab to your domain-name, you should now connect to your site, and see the WordPress login screen.
- Login using the username: user, password: bitnami_application_password obtained above.
Create a Snapshot of your site
- Return to the AWS Lightsail console
- Select the new instance
- Select the Snapshots tab.
- Click + Create snapshot, provide a name, click Create.
- While in the snapshots page, slide the switch to enable Automatic snapshots, if desired.
Complete WordPress Configuration
- Return to your website on your browser.
- If desired, add a new username with Administration rights, login with it to continue your work (the bitnami provided user can then be removed).
- Complete the WordPress configuration as normal. For example, configure themes, pages, posts, appearance, etc.
Good luck! I found the references at the top of this post to be helpful.