How to use your domain with a Lightsail instance

It's just a simple guidance on how to use your domain with a Lightsail instance.

I'll consider a situation when you have bought a domain using Namecheap (could be any domain registrar) and have created a Lightsail instance with Debian.

The complete list of steps will look like:

  1. Create a static IP
  2. Create and configure a DNS zone
  3. Change networking settings
  4. Use AWS nameservers for your domain
  5. Install and setup nginx*
  6. Setup Let's Encrypt SSL certificate*

Create a static IP

  1. Open Networking page
  2. Click on Create static IP
  3. Pick up a name for your static IP
  4. Click on Create
  5. Open Networking page
  6. Click on your static IP
  7. Attach it to your instance

Create and configure a DNS zone

  1. Open Domains & DNS page
  2. Click on create DNS zone
  3. Specify your registered domain name
  4. Click on create DNS zone
  5. Assign your registered domain name to your created zone
  6. Add DNS records

Change networking settings

  1. Open the page with your instance
  2. Open Networking tab
  3. Make sure you have left opened only ports that you need (in my case, it's only 22 and 443)

Use AWS nameservers for your domain

  1. Open Domains & DNS page
  2. Open the page with your DNS zone
  3. Copy your name servers
  4. Use your name servers in the dashboard of your domain register (I used Namecheap)
  5. You can use dnschecker to see if changes were applied (it will take some time)

Install and setup nginx*

This topic is skipped because it's pretty basic and available in the internet

Setup Let's Encrypt SSL certificate*

This topic is well covered in the official doc (If you need a free SSL certificate for your site then you can follow this step)

* - optional steps