Skip to main content

Amazon Lightsail

The absolute cheapest plan is USD $3.50/month as of this writing, but it’s limited on RAM. I’ll use the $5/month bundle, which right now includes 1GB of RAM and 40GB of persistent storage. Costs are prorated, so you don’t have to pay for an entire month to follow along, as long as you remember to delete your Lightsail instance once you’re done.

You can have a look at the Lightsail pricing page for details. Don’t worry about mentions of databases and containers; although we’re using containers and one of those includes a database, we don’t need a bunch of separate infrastructure. We’ll just host what we need inside our self-contained core Lightsail server. Keep in mind that bandwidth on AWS can get pretty expensive (at 9 cents per gigabyte transferred). Lightsail includes at least one terabyte of transfer per month, but if you exceed that without noticing, you might be in for an expensive bill.

Log into Amazon Web Services (creating an account if you don’t already have one) and search for Lightsail. Create a new instance, choosing to preinstall on the “Linux/Unix” platform. You don’t need to preinstall any applications. I’m using Ubuntu 22.04 LTS as my host’s operating system.

Lightsail setup: pick Ubuntu 22.04 LTS

Choose the machine with the price and specs you’re happy with, and give it a name if you’d like. Then click “Create Instance”.

Once that’s finished running, you’ll have a new button to access your server. Click into the Lightsail instance, then head over to “Networking” and click “Attach Static IP” to get an IP that won’t change. By default, Lightsail instances come configured with a firewall that allows traffic only on port 22 (for SSH) and port 80 (for web traffic). Now would be a good time to allow port 443 (for both IPv4 and IPv6) as well, in case we want to configure HTTPS access later.

In the Connect tab, you can get SSH connection instructions. I downloaded the SSH key generated for me, then used ssh from my computer’s terminal:

$ chmod 400 ~/Downloads/LightsailDefaultKey-us-west-2.pem
$ ssh -i ~/Downloads/LightsailDefaultKey-us-west-2.pem ubuntu@54.245.148.148

The default user has sudo access, so we’ll be able to install Docker.