Set up custom domain in Cloud Edition

Sign up for Amazon Lightsail account. Amazon Lightsail offers cost-effective virtual servers. You can set up virtual server for custom domain which will proxy traffic to your subdomain.

Once logged into Amazon Lightsail, click Create Instance button.

Select Select your instance location which should be the where you site is hosted. If you don’t know where your site is hosted, go to and click Speed Test button to see where your data is hosted.

Select Linux/Unit platform.

Select OS Only, then Ubuntu 20.04 LTS

Select the cheapest price option for your region.

Then click Create Instance button.

Go to Networking tab.

Then click Create static IP button.

In Attach to an instance section, select your server.

Then click Create button.

This will reveal your Public static IP address. Use this IP address to create A record for your custom domain so it points to your public static IP address you just created. This is something you will need to do in DNS settings for your domain.

After your DNS is configured. You should verify that your custom domain points to your static IP address (e.g. using ping command).

Then under Networking tab for your instance, make sure HTTPS protocol is added to your firewall rules. By default HTTPS is not added.

Go back to details of your instance and click Connect using SSH

This will open terminal window. Copy and paste the following commands.

This will download Caddy 2.2.0:


This will extract the archive you just downloaded:

tar xvzf caddy_2.2.0_linux_amd64.tar.gz

This will move caddy binary to your bin folder.

sudo mv caddy /usr/local/bin/

This command will launch caddy as reverse proxy. Make sure to replace example domains for your actual domain names.

  • Replace for your actual custom domain name for which you set up A record in previous steps.
  • Replace for your actual subdomain.

caddy reverse-proxy --from --to --change-host-header

After launching the the command, test in web-browser to access your custom domain. If it’s working, install the systemd service unit configuration file. Again, don’t forget to replace and for your actual domain names.

printf "[Unit]\\n\n[Service]\nLimitNOFILE=1048576\nExecStart=/usr/local/bin/caddy reverse-proxy --from --to --change-host-header\nRestart=always\nStartLimitInterval=600\n\n[Install]\" | sudo tee /etc/systemd/system/caddy.service

Then start Caddy.

sudo systemctl start caddy

Also have the Caddy Server service start automatically on boot so you don’t have to start it manually.

sudo systemctl enable caddy

Verify your custom domain is still working.


Get Involved
Subscribe to Updates

Subscribe to our newsletter and get exclusive product updates you won't find anywhere else straight to your inbox.

© 2021 — Based in Sydney, Australia but providing goodness globally