Running ReadyRoam on AWS or Google Cloud
This guide is for a small company or team that wants a ReadyRoam server on
its own cloud account instead of a machine at home. It is the same server and
the same Docker setup as in Running a ReadyRoam server,
placed on one virtual machine in the cloud, with https and a domain name in
front of it.
A small virtual machine is a starting point for a small deployment; monitor memory, disk usage and attachment traffic as your team grows. You do not need Kubernetes, load balancers or a managed container service. If you outgrow one machine, or your company requires a managed database, see Going further.
No domain? You can still use a cloud VM: install Docker and follow the Docker setup and Tailscale guide on it, instead of the public-IP/DNS/Caddy steps below. Your home connection needs no public IP in either cloud approach.
What you need
- An AWS or Google Cloud account that can create virtual machines.
- A domain name you control, where you can add a DNS record (for example
roam.megadodo.example). The server gets an address from it and a free certificate from Let's Encrypt. - A budget for the VM, disk, backups, public IPv4 address where charged, and network traffic. Review the provider’s estimate and configure billing alerts before creating resources.
The steps are the same on both clouds apart from creating the machine and opening the firewall (steps 1 and 2). Everything from step 3 on is identical.
1. Create the virtual machine
Choose a size of 1–2 vCPUs, 2 GB of memory and a 20 GB disk. The server image runs on Intel/AMD and on ARM, so the cheaper ARM machines work too. Pick a region close to your users, and in the EU if your company has data residency requirements. Use the current Ubuntu Server LTS as the operating system.
AWS
The simplest route is Lightsail (a fixed monthly price, firewall and static IP built in):
- Lightsail → Create instance → Linux/Unix → OS only → Ubuntu.
- Choose a plan with 2 GB of memory.
- Create it, then under Networking create a static IP and attach it.
If your company already works in EC2, an EC2 instance of a similar size
(t4g.small for ARM, t3.small for Intel/AMD) does the same. Allocate an
Elastic IP and associate it with the instance, so the address survives
restarts.
Google Cloud
- Compute Engine → Create instance. An
e2-smallis a shared-core, 2 GiB starting point for light workloads; increase capacity if monitoring shows it is needed. - Boot disk: Ubuntu LTS, 20 GB.
- Under Firewall, tick Allow HTTP traffic and Allow HTTPS traffic.
- Under VPC network → IP addresses, reserve a static external IP and assign it to the instance, so the address survives restarts.
2. Open the firewall and point your domain at it
The machine needs these ports open to the internet, and nothing else:
| Port | Used for |
|---|---|
| 443 | The app talking to the server (https) |
| 80 | Getting and renewing the free certificate |
| 22 | Your own SSH access. Restrict it to your office or VPN address if you can. |
On AWS this is the Lightsail Networking → IPv4 Firewall tab, or the instance's security group in EC2. On Google Cloud the two checkboxes in step 1 cover 80 and 443; SSH depends on the VPC and firewall configuration: the default network may include an allow-SSH rule, but custom networks do not necessarily have one. Restrict SSH to your administrative source addresses or use the provider’s private access tooling. Never open the Postgres port (5432) or 8080 to the internet; the setup below doesn't need it.
Then, at your DNS provider, add an A record for the name you chose
(roam.megadodo.example) pointing at the static IP. Check it with
dig +short roam.megadodo.example before you continue; it should print the IP.
3. Install Docker
Connect over SSH, then follow Docker’s Ubuntu installation guide using the official apt repository and Compose plugin. Docker does not recommend its convenience installation script for production.
Verify installation with sudo docker compose version. If you choose to add your user to the docker group, log out and back in afterwards; this grants root-equivalent control over the machine. The commands below assume your user can run Docker.
4. Set up the server
Follow steps 2 and 3 of the setup guide
to create the folder, the docker-compose.yml and the .env, with these
differences in .env:
PUBLIC_URL=https://roam.megadodo.example
TRUST_PROXY=true
REGISTRATION=closed
SERVER_NAME="Megadodo Travel"
REGISTRATION=closed is the right default for a company: people get accounts
from you (or from single sign-on, step 6), not by finding the address.
5. Add Caddy for https
Caddy sits in front of the server, fetches the certificate itself and renews
it. In docker-compose.yml:
-
Change the server's port line so it is no longer reachable from outside:
ports:- "127.0.0.1:${PORT:-8080}:8080" -
Add
caddyalongsideserveranddbinside the existingservices:block. Addcaddy-datato the existing top-levelvolumes:block; do not create duplicatevolumes:keys:caddy:image: caddy:2restart: unless-stoppedports:- "80:80"- "443:443"volumes:- caddy-data:/datacommand: caddy reverse-proxy --from roam.megadodo.example --to server:8080volumes:db-data:caddy-data:
Check the merged file with docker compose config --quiet, then start it and check:
docker compose up -d
curl -fsS https://roam.megadodo.example/healthz # {"status":"ok"}
The first request can take a few seconds while the certificate is issued. If it fails, the usual causes are the DNS record not pointing at the IP yet, or port 80 closed in the firewall.
Then connect the app as described in
step 5 of the setup guide, with the
address https://roam.megadodo.example. Create the first accounts with the
admin tool.
6. Sign-in for a company
Two things make a company server pleasant to run:
- Single sign-on. If the company uses Microsoft 365 or Google Workspace,
people can sign in with their work account and you don't hand out
passwords. See step 8 of the setup guide
(including Microsoft Entra ID).
For a single provider, configure
SSO_SIGNUPdeliberately and useSSO_ALLOWED_DOMAINS=megadodo.examplewhere domain restrictions are appropriate. WithSSO_CONFIG, use each provider’ssignupandallowed_domainsfields instead; do not mix single-provider environment settings with file configuration. Entra assignment rules also control access. Then setPASSWORD_LOGIN=falseonce it works if you want single sign-on to be the only way in. - Email for password resets (if you keep password sign-in). Use your
mail provider's SMTP: Amazon SES on AWS, or your Google Workspace SMTP
relay on Google. Set the
SMTP_*settings from the table in step 3.
7. Backups
The data lives in one place: the db-data Docker volume, on the machine's
disk. Do both of these:
-
Take a database dump every night and keep it somewhere other than the machine. Put this in the crontab (
crontab -e) of the user that owns the folder:0 3 * * * /bin/bash -o pipefail -c 'umask 077; cd ~/readyroam && docker compose exec -T db pg_dump -U readyroam readyroam | gzip > ~/backups/readyroam-$(date +\%F).sql.gz'(Create
~/backupsfirst with mode 700.) Monitor failures and only upload successful dumps; a file existing does not prove that the dump completed. Then copy the dumps to a storage bucket: an S3 bucket withaws s3 sync, or a Cloud Storage bucket withgcloud storage rsync. Give the machine a role or service account that can write to that one bucket only, and use a bucket lifecycle rule to expire old dumps. -
Turn on scheduled disk snapshots: Lightsail automatic snapshots, AWS Data Lifecycle Manager, or a Google Cloud snapshot schedule. A snapshot restores the whole machine quickly; the dumps are what you can restore into a fresh server on any machine.
Test recovery into a separate, disposable database or VM, with the app stopped there. Do not run a restore against your live database as a test. Use a fresh database and stop on SQL errors (psql -v ON_ERROR_STOP=1), then check accounts and trips before treating the backup as verified.
8. Keeping it up to date
Updating is the same as anywhere else, and the database is updated automatically:
cd ~/readyroam
# First take and verify a database backup, as described above.
docker compose pull
docker compose up -d
For controlled upgrades, pin an exact published version in READYROAM_VERSION and change it only after reviewing release notes and backing up. Major/minor aliases and latest are moving tags; none automatically update a running container without a pull/recreate or a separate updater. Migrations may prevent downgrading without restoring a backup. Apply operating system
updates with sudo apt update && sudo apt upgrade now and then, or turn on
unattended upgrades (sudo apt install unattended-upgrades). Machine
restarts are fine: every container restarts itself.
Going further
- Managed database. If the company wants Amazon RDS or Cloud SQL for
PostgreSQL (automatic backups, patching and failover), remove the
dbservice and the server’sdepends_on: dbentry. Replace the server’s hard-codedDATABASE_URLmapping in Compose with${DATABASE_URL:?set DATABASE_URL in .env}, then configure the managed connection in.env. Setting.envalone does not override the original mapping. Configure network access and TLS/certificate verification according to the database provider and client; do not assumesslmode=requirealone verifies server identity. The server keeps its data in a normal PostgreSQL database and needs nothing else from it. Compare the provider’s current pricing; managed database costs depend on size, availability and backup settings. - Monitoring. Point an uptime check at
https://roam.megadodo.example/healthz(Route 53 health checks, Google Cloud uptime checks, or any external service) and alert on failures. - Private access. If the company would rather keep the server off the public internet entirely, put the machine behind the company VPN, or use the Tailscale guide on the cloud machine instead of Caddy.
- More than one server instance. The server holds its state in the database, but it is not designed or tested to run as several copies behind a load balancer. One machine is the supported setup.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Caddy can't get a certificate | The A record doesn't point at the machine's static IP yet, or port 80 isn't open in the firewall. docker compose logs caddy says which. |
https://…/healthz works but the app can't sign in | PUBLIC_URL is still the old address, or docker compose up -d wasn't run after changing .env. |
| The address stopped working after a restart | The machine got a new public IP: attach a static IP (step 1) and update the DNS record. |
| Everybody gets blocked after a few failed sign-ins | TRUST_PROXY isn't true, so all visitors look like one. |
| Out of disk | docker system df shows what's using it. Increase the disk in the console, then grow the file system. |