Deploy Hatamoto on Amazon Lightsail
By the end you have Hatamoto running on an Amazon Lightsail instance with HTTPS, a static IP that keeps your domain pointed at it, and a setup link in the browser console. A launch script does the install, and two console changes finish the job: port 443 and the static IP. The install itself takes a few minutes.
Lightsail bundles the server, disk and transfer into one price. The Micro-1GB bundle is $7 a month, and a static IP is free while it is attached.
What it costs
Hatamoto needs 1 GB of RAM, so the $5 Nano-0.5GB bundle is too small. These Linux bundles include a public IPv4 address. Lightsail bills by the hour and keeps charging while an instance is stopped.
| Item | Price |
|---|---|
| Micro-1GB: 2 vCPUs, 1 GB RAM, 40 GB SSD, 2 TB transfer | $7 a month |
| Small-2GB: 2 vCPUs, 2 GB RAM, 60 GB SSD, 3 TB transfer | $12 a month |
| Static IP, attached to an instance | Free |
| Static IP, unattached for more than an hour | $0.005 an hour |
| Snapshots | $0.05 per GB, billed monthly |
Prices as of 13 November 2026, from Lightsail's pricing page and its bundles guide. Bundles in Asia Pacific regions, which include Sydney, carry half the transfer allowance shown. They change, so check the provider before you order.
Before you start
- An AWS account. The Lightsail console is at lightsail.aws.amazon.com.
- A domain whose DNS records you can edit, if you want a name of your own. Without one, Hatamoto serves a free sslip.io name built from the address the instance had during the install.
- An email address that the certificate authority can use for expiry notices.
Step 1: Open Create instance and pick a location
Sign in at lightsail.aws.amazon.com and choose Create instance. Pick the AWS Region and Availability Zone nearest your visitors, using Change AWS Region and Availability Zone if the default is wrong.
Step 2: Choose Linux and an operating system
Choose the Linux platform, then the OS Only tab, then Ubuntu 24. Ubuntu 22 and Debian 12 and 13 also work with Hatamoto.
Step 3: Add the launch script
Scroll down and choose Add launch script. Paste this script in:
#!/bin/sh
sh -c 'curl -fsSL -o /tmp/hatamoto-install.sh https://hatamoto.dev/install.sh && chmod +x /tmp/hatamoto-install.sh && env HATAMOTO_DOMAIN=cms.example.com HATAMOTO_ADMIN_EMAIL=you@example.com /tmp/hatamoto-install.sh'Put your domain after HATAMOTO_DOMAIN= and your email after HATAMOTO_ADMIN_EMAIL=. With no domain, delete the whole env part so the command ends with /tmp/hatamoto-install.sh. Lightsail runs it as root, so there is no sudo. Anyone with console access can read the script later, so leave a secret setup code out and Hatamoto generates one.
Step 4: Choose the key pair, plan and name
Lightsail offers the region's default key pair, a new key or an existing public key you upload. The default is fine, because the browser SSH client has its own key. Pick the plan: Micro-1GB at $7 a month, or Small-2GB at $12. For networking, choose dual-stack (IPv4 and IPv6), not IPv6-only. Type an instance name of 2 to 255 characters, then choose Create instance.
Step 5: Attach a static IP straight away
In the left navigation choose Networking, then Create static IP. Pick the same Region, choose the instance, name the address and choose Create. A pushpin icon then marks the address on the instance's Networking tab.
Do this at once because of how the installer finds the address. On Lightsail the public address is not on the server, so the installer asks api.ipify.org for it during the install and logs a warning that the answer is not bound on the machine. That warning is normal here. The sslip.io name and the setup link come from that answer, and a domain waits for DNS to match it. Attaching a static IP replaces the dynamic address, so an install that read the old one holds a stale address. Step 9 explains how to check.
Only trying it out, with no domain? Skip this step. The sslip.io name works until you stop and start the instance, which changes the dynamic address.
Step 6: Point your domain at the static IP
At your DNS host, add an A record for the domain you put in the script, with the static IP as its value. If the install read the static IP, Hatamoto switches to your domain within minutes of the record working. No domain? Go on to step 7.
Step 7: Open port 443
On an OS-only instance Lightsail opens only SSH on 22 and HTTP on 80. Open the instance, choose the Networking tab and scroll to IPv4 Firewall. Choose Add rule, pick HTTPS in the Application drop-down (TCP, port 443) and confirm. Repeat under IPv6 Firewall, a separate list. The installer turns on the server's own firewall itself, so this is the only rule you change.
Step 8: Watch the install in the browser SSH client
On the Lightsail home page, open the menu beside the instance name and choose Connect, or use Connect using SSH on the instance's Connect tab. You are the ubuntu user (admin on Debian). Follow the install with:
sudo tail -f /var/log/cloud-init-output.logThe login message shows the setup link block each time you sign in until the owner account exists.
Step 9: Check which address the install used
In that block, the setup link's host is the address the install read, written with dashes: 198-51-100-7.sslip.io means 198.51.100.7. Compare it with your static IP. If they match, nothing more is needed. With a domain, Hatamoto switches once the A record works.
If they differ, the install read the old dynamic address, and your A record can never match it. Download the installer again and run set-domain with the static IP given explicitly, using your own address and domain:
curl -fsSLO https://hatamoto.dev/install.sh
chmod +x install.sh
sudo env HATAMOTO_PUBLIC_IP=198.51.100.7 ./install.sh set-domain cms.example.com --email you@example.comIf DNS matches, the site switches, restarts and prints a new admin link. If not, the current name keeps answering and Hatamoto switches by itself later. With no domain, give it the sslip.io name of the static IP instead:
sudo env HATAMOTO_PUBLIC_IP=198.51.100.7 ./install.sh set-domain 198-51-100-7.sslip.ioThis route has not been run on a live Lightsail instance for this page. The same command repairs a setup link that died after a stop and start: give it the new address.
Step 10: Open the setup link and turn on snapshots
Open the link from the block, or the admin link set-domain printed if you ran it. The code is filled in for you and the part after # never leaves your browser. Create the owner account and read First run.
Open the instance, then the Snapshots tab. Under Manual snapshots, choose Create snapshot, name it and choose Create. Under Automatic snapshots, switch the toggle on and choose Yes, enable. Lightsail then snapshots daily and keeps the latest seven.
Check it worked
In the browser SSH client, run:
curl -i http://127.0.0.1:8090/healthExpect HTTP/1.1 200 OK on the first line. Open your domain next. A padlock and the starter home page mean it worked. On the sslip.io name, the address bar shows your static IP in dashes.
If something goes wrong
- If port 80 answers and HTTPS never loads, add the HTTPS rule on the IPv4 Firewall, and again on the IPv6 Firewall if you use IPv6.
- If the setup link stopped working, the address changed. Run
set-domainwithHATAMOTO_PUBLIC_IPset to the current address, as in step 9. - If the install log shows a NAT warning, that is expected on Lightsail, where the public address sits in front of the instance.
- If the static IP will not attach, check that the instance is dual-stack, because an IPv6-only instance cannot take one, and that both are in the same Region.
- If you are still charged after deleting an instance, delete its static IP too. An unattached one costs $0.005 an hour after the first hour.
Use the command line instead
aws lightsail create-instances takes the launch script in --user-data. Save the script as hatamoto-launch.sh. Run the three lookups first and note the Micro-1GB bundle id, the Ubuntu 24.04 blueprint id and a zone in your Region:
aws lightsail get-bundles --query "bundles[].[bundleId,name,price,ramSizeInGb]" --output table
aws lightsail get-blueprints --query "blueprints[].[blueprintId,name,version]" --output table
aws lightsail get-regions --include-availability-zones
aws lightsail create-instances \
--instance-names hatamoto \
--availability-zone <zone from get-regions> \
--blueprint-id <Ubuntu 24.04 id from get-blueprints> \
--bundle-id <Micro-1GB id from get-bundles> \
--user-data "$(cat hatamoto-launch.sh)"
aws lightsail allocate-static-ip --static-ip-name hatamoto-ip
aws lightsail attach-static-ip --static-ip-name hatamoto-ip --instance-name hatamoto
aws lightsail open-instance-public-ports --instance-name hatamoto --port-info fromPort=443,toPort=443,protocol=TCPReplace each <...> with a value from the lookups. The flags come from the AWS CLI reference and none of the commands has been run for this page. Attach the static IP right after the create command returns.
FAQ
How much does Hatamoto cost to run on Lightsail?
The Micro-1GB bundle is $7 a month with a public IPv4 address, 40 GB of SSD and 2 TB of transfer. A static IP is free while attached. Hatamoto is free to install.
Why is the setup link built from the wrong address?
Hatamoto asks an outside service for the public address during install and uses the answer even though the server does not hold it. If you attach a static IP afterwards, the link is out of date. Run set-domain with HATAMOTO_PUBLIC_IP, as in step 9, for a fresh one.
Does Lightsail offer arm64 instances?
The Lightsail pages used for this guide list no Arm bundles, so it covers amd64.
Which Ubuntu should I choose?
Ubuntu 24, on the OS Only tab. Lightsail does not list Ubuntu 26.04.
Do I have to open port 443 myself?
Yes. On OS-only images Lightsail opens SSH and HTTP only. Add HTTPS on the Networking tab, on both the IPv4 and IPv6 firewalls.
Is there a free trial?
Lightsail's billing FAQ says new customers can start with AWS Free Tier credits of up to $200. Check AWS for the terms before you rely on it.
Hatamoto installs the same way on DigitalOcean, Vultr, Amazon EC2, Hetzner Cloud and Linode. The full option list is in Install on a VPS.