Want to install WordPress on Amazon Lightsail but not sure where to start?
With its pre-made application blueprints, Amazon Lightsail makes it very easy to get up and running with a fully functioning WordPress site.
In this step-by-step tutorial, you’ll learn exactly how to set everything up.
By the end, you’ll have a working WordPress site on Amazon Lightsail, completely with a custom domain name and a free SSL certificate from Let’s Encrypt.
Let’s dig in!
How to Install WordPress on Amazon Lightsail
Here’s a high-level look at how to install WordPress on Amazon Lightsail – keep reading for the full instructions:
- Create a new instance in Amazon Lightsail
- Access your WordPress credentials to log into WordPress
- Attach a static IP address to your instance
- Point your domain name to your instance
- Install a free SSL certificate from Let’s Encrypt
1. Create a New Instance
To get started, log in to the Amazon Lightsail dashboard.
If this is the first time that you’re using AWS, you might need to create an account before you can access the dashboard.
Once you’re in the Amazon Lightsail dashboard, click the button to create a new instance:
On the next screen, choose Linux/Unix as the platform and then select the WordPress blueprint (both of these should be selected by default).
Further down the page, you can choose your instance plan, which controls the resources and price of your server.
While you’re free to choose any plan, I recommend the $5 instance for most WordPress sites, which gets you 1 GB of RAM and 1 vCPU.
As long as you use caching and don’t have a lot of dynamic content, this plan alone should be able to support hundreds of thousands of visits per month.
Below that, you can give your instance a name, which will help you remember it.
Once you’ve made your choices, click the Create Instance button at the bottom to spin up your instance.
Now, you’ll have a short wait while Amazon Lightsail creates your instance.
Once it’s finished, you should see the instance appear in your AWS Lightsail dashboard:
To open the dashboard for just this instance, click on the instance name.
2. Access Your WordPress Credentials
At this point, you already have a working WordPress website.
You can access it by pasting the Public IP into your browser address bar:
However, what you don’t have yet is your WordPress username and password, so you can’t log in to your site yet.
By default, your WordPress site will use user as the username. However, to access the password, you’ll need to use the command line. But don’t worry! It’s pretty easy and it doesn’t require installing any new software.
To get started, open the browser-based SSH client for your instance, which you can do by clicking the Connect using SSH option in your instance dashboard:
This will open a popup command line interface that you can work with in your browser.
There’s no need to log in or authenticate or anything – everything is ready to go.
To access your WordPress user password, all you need to do is paste in the following command and hit enter.
You should then see your password appear – copy it to a safe place so that you can use it to log in:
Now, you can log in to your WordPress install using the following credentials:
- Username: user
- Password: from the terminal window above
3. Attach a Static IP Address to Your WordPress Instance
While you can already access your WordPress site from the public IP address of your instance, you can’t rely on this public IP address as-is.
That’s because, with the current configuration of your instance, the public IP address will change each time you stop/start your instance.
So if you pointed your domain name to this public IP address, the domain connection would stop working if you ever restarted your instance.
To fix this, Amazon Lightsail lets you attach a static IP address to your instance at no extra cost.
Once you attach the static IP address, your instance will always have the same IP address no matter what.
To create one, go to the Networking tab in your instance’s dashboard. Then, click the Attach static IP option:
This will open a popup. Give your static IP address a name and then click the Create and attach button:
Now, your instance will have a new, static IP address. You should see this reflected in the Networking tab of the instance dashboard, as well as the information summary in the top-right corner.
4. Point Your Domain Name to the Static IP Address
Now that you’ve attached a static IP address to your instance, you’re ready to point your domain name to your instance.
This will let you access your WordPress site by entering the domain name, instead of needing to use the IP address.
To set this up, you’ll need to work from wherever you manage your domain’s DNS records. Typically, this will be your domain registrar. Or, if you’re using a service like Cloudflare, you’ll manage these records from your Cloudflare dashboard.
Alternatively, you can also transfer DNS management to Lightsail so that you can manage DNS records using the Lightsail console, though this requires a few extra steps.
The simplest option is to just go to wherever you manage your domain’s DNS records and add the following records:
|[static IP address]
This assumes you want to use yoursite.com and not www.yoursite.com.
Here’s what it looks like at Cloudflare:
Now, you can access your WordPress instance by entering your domain name:
Your WordPress site should automatically detect the correct domain name. But to double-check, you can go to Settings → General and verify that your domain name shows up as the WordPress Address and Site Address.
5. Set Up Your SSL Certificate
At this point, you have a working WordPress website that’s accessible via your domain name.
For the last bit of the process, you’ll want to install an SSL certificate so that your site can benefit from HTTPS.
As part of the WordPress blueprint, Amazon Lightsail and Bitnami install the fundamental tools that you need to set up a free SSL certificate via Let’s Encrypt.
However, to enable the SSL certificate, you’ll need to run a few commands in the in-browser terminal window.
Go back to your instance dashboard and open the in-browser terminal window by clicking the Connect using SSH option.
Then, run the following command:
You might see a prompt to update bncert. If you do, just enter Y. Then, run the command above again.
Now, enter the non-www and www versions of your domain name, separated by a space, and hit enter. Here’s an example:
You’ll then see a prompt to enable HTTP to HTTPS redirection. Enter Y to enable it and hit enter.
You can then choose between setting up a non-www to www redirection or the reverse.
Finally, you’ll see a summary of your choices. If everything looks good, enter Y and hit enter to finalize the configuration.
As part of the setup, you might need to enter an email address to use with Let’s Encrypt.
And that’s it! Once Bitnami finishes (it should only take a few seconds), you’ll now be able to use HTTPS on your site.
If you visit your site, you should now see the green padlock.
Your site is now ready to go.
Create a WordPress Site With Amazon Lightsail
With Amazon Lightsail, you can easily spin up a WordPress site powered by Amazon’s cloud network.
The pre-built blueprints help you get up and running in just about 15 minutes, all without needing any special technical knowledge.
The Lightsail blueprints also can handle important details such as installing a free SSL certificate from Let’s Encrypt.
If you want to try it out for yourself, you can get your first three months free when you create a new instance.
Give it a shot today and you’ll be up and running in no time.