How to Install WordPress on AWS EC2

This guide will walk you through connecting an AWS EC2 Instance to SpinupWP. Before you start this process, you will need to sign up for an Amazon AWS account if you don’t already have one.

Launch An Instance

Once signed in to Amazon AWS, navigate to Services > EC2. If you’re presented with the EC2 dashboard, click Launch Instance about halfway down the screen.

EC2 Dashboard

Alternatively, if you’re presented with the list of instances, click Launch Instances on the top right of that list.

EC2 List

You’ll be asked to choose an Amazon Machine Image (AMI), select “Ubuntu Server 24.04 LTS”, the “64-bit (x86)” version.

EC2 AMI Selection

You’ll be asked to choose the Instance Type. For this guide, we’ll be using the default “t2.micro” instance, which has 1 vCPU and 1GB of memory. Click Review and Launch.

EC2 Instance Type

A modal will appear asking you to choose a key pair. As you’ll be adding the SpinupWP SSH key to the instance’s authorized_keys file before we provision the server, select “Proceed without a key pair” from the dropdown, check the checkbox, and click Launch Instances.

EC2 no key pair selected

If everything works as expected, you’ll be presented with the “Launch Status” screen. Click View Instances to continue.

EC2 Launch status screen

The newly created instance will appear in your Instances list, with an Instance State of “Running”.

Connect Your Instance To SpinupWP

Once you have a freshly created EC2 instance, you are ready to provision the server via SpinupWP.

You will need to connect to the server so that you can add the SpinupWP SSH key to the authorized_keys file. Within AWS, tick the checkbox next to the Instance in the list, then click the Connect button.

EC2 Connect to instance

The next “Connect to Instance screen” shows the details of the instance. Make a note of the “Public IP address” and click Connect. This will open a terminal connection via a new browser window or tab.

EC2 Connect to instance info

The SSH console will connect using the default SSH user which is generated based on the type of AMI you used. In the case of Ubuntu, the username is ubuntu.

Now, head over to SpinupWP and click Spin Up a New Server followed by Use Another Provider.

SpinupWP Spin up a new server

Choose AWS from the list of supported providers.

SpinupWP Spin up a new AWS server

Enter the server’s external “IP address”, the “SSH Port” should default to 22 and the “SSH Username” to ubuntu, and select Public Key authentication. Copy the command provided by SpinupWP for adding the SpinupWP SSH key to the EC2 instance’s authorized_keys file.

SpinupWP Provision the new instance

Paste this string into the SSH terminal browser window you opened earlier, and hit Enter.

EC2 update the authorized keys file

Switch back to SpinupWP and confirm that it can connect to the EC2 instance by Next. Once you see the success message, you can Click Next again to continue.

SpinupWP connection success

Enter the server’s hostname and choose a timezone, then select the desired database server. Click Provision Server to begin the provisioning process.

SpinupWP Provisioning

Once the server has finished provisioning you’re ready to start adding sites.

Next Steps

Once you’ve completed the SpinupWP provision process, you are ready to fine-tune settings and add a site. For more information on these steps, see our Getting Started doc.

What to expect after adding a site? You’ll have the option to configure your server and sites to your needs via the SpinupWP dashboard.

You’ll be able to quickly enable page caching. When enabled, SpinupWP configures full page caching, essentially turning your site into a static site and dramatically improving the load time of your site.

You can also toggle on an SSL certificate to enable HTTPS. This generates a free Let’s Encrypt certificate so you don’t have to manually manage this yourself. If you’d prefer to use a custom SSL certificate, you’ll have the opportunity to upload that instead.

If you’re looking to add rewrite rules or prevent PHP scripts from being executed in the uploads folder, the Nginx settings steps will cover that.

We’ll also cover enabling SFTP & SSH access to your site and setting up site backups.

SpinupWP can take care of automated daily site backups which include full backups of your site files (media, themes and plugins). You’ll have the option to backup to Amazon S3, DigitalOcean Spaces, Akamai/Linode, Google Cloud Storage, Wasabi or Backblaze B2.

Follow our Getting Started Guide for step by step instructions for all of the above mentioned features and more.