Dota Picker · going live

Running it on AWS

The ways to host a small web app on Amazon, what each costs, how locked-in each one makes you, and why one small server is the right first step.

Prices are rough monthly figures for us-east-1, low traffic, September 2026. Check the AWS pricing calculator before buying.

What we're actually hosting

Browserdoes the screen matching
→ HTTPS →
1 containerFastAPI + pages
→
1 SQLite file+ hero pictures on disk
·
OpenDotaoutbound, cached

Small

A few hundred MB of memory. The heavy work, reading the draft screen, runs in each player's browser, not on the server.

Stateful

Accounts, stars, box setups and labelled pictures live in one SQLite file. It needs a disk that stays put.

One process

The login throttle and caches are in memory. That's fine on one server; a fleet would need a shared store.

How we'll judge the options

💵 Cost

The monthly bill at our size, including the easily missed items: load balancers, public IPs, managed databases.

🔓 Portability

Could we move to another cloud, or back home, in an afternoon? You're fine being Amazon-specific only for S3 and CloudFront.

🧰 Simplicity

How many moving parts, and how much there is to learn and look after: deploys, TLS, backups, updates.

💾 Data safety

What happens to the SQLite file if the machine dies, and how fast we can get it back.

The menu: six ways to run a container on AWS

EC2 portable

A plain virtual machine. You install Docker and run our compose file. Full control; you patch the OS.

Lightsail portable

EC2's simple sibling: a VM at a flat price with a public IP and data transfer included. Same Docker setup.

ECS on Fargate AWS-only

AWS runs your container with no server to manage. No lasting local disk, and it needs a load balancer.

App Runner AWS-only

Push an image and get a URL with HTTPS. Very easy, but no lasting disk, so the data must go elsewhere.

Lambda rewrite

Functions per request, billed per call. Cheap at rest, but our app would need restructuring and a different database.

EKS (Kubernetes) overkill

About $73/month for the control plane alone, before any servers. Built for fleets, not one container.

Why the SQLite file decides it

A server with its own disk

  • The file lives on the server's disk (EBS)
  • Survives restarts and redeploys
  • Backed up to S3 all the time (Litestream)
  • No database server to pay for or run

Fargate / App Runner / Lambda

  • The container's disk is wiped on every restart
  • SQLite over a network drive (EFS) is unsafe: its locking isn't reliable there
  • So they need a managed database (RDS Postgres): +$15–30/mo and a database migration

The "serverless" options aren't expensive to run. They're expensive to move to: they force a database change we don't otherwise need.

What each option costs at our size

OptionWhat you pay for≈ per monthCode changes
Lightsail 2 GBFlat plan: VM, 60 GB SSD, public IPv4, 3 TB transfer$12none
EC2 t4g.smallVM $12 + 20 GB disk $1.60 + public IPv4 $3.65$17none
App Runner + RDSSmall instance ~$5–15 + RDS db.t4g.micro ~$13 + storage$25–35move to Postgres
ECS Fargate + ALB + RDSTask ~$9 + load balancer ~$18 + RDS ~$15$40+move to Postgres
Lambda + DynamoDBNear $0 idle, but a restructure$0–5large rewrite
EKSControl plane $73 + nodes$100+Kubernetes

Easy to miss: AWS charges ~$3.65/month for every public IPv4 address (Lightsail plans include one), and a load balancer costs ~$16–18/month even with no traffic.

Recommended: one small server, Docker Compose

Playersbrowser
→
DNSany registrar or Route 53
→
Lightsail or EC2 · Docker Compose
CaddyHTTPS, free certs
→
dotapickersame image as MODEL
→
SQLiteon the disk
→
Litestreamstreams changes
→
S3backups

Caddy instead of a load balancer

Gets and renews Let's Encrypt certificates by itself, which saves ~$18/month versus an AWS load balancer with a certificate.

Litestream instead of RDS

Copies every SQLite change to S3 within seconds. Restoring on a new server is one command.

The same image everywhere

MODEL and live run the identical container. Only settings differ (login mode, admin network).

How tied to Amazon are we?

PieceAmazon-specific?If we left AWS
Virtual machine (Lightsail / EC2)noAny VM anywhere: Hetzner, DigitalOcean, or back home
Docker Compose + Caddy + app imagenoCopy the folder and run the same command
Litestream → S3S3 API, which you acceptPoint it at Backblaze B2, Cloudflare R2 or MinIO: one setting
CloudFront (optional)yes, which you acceptDrop it, or use any CDN
Email for verification (later)no, if sent over plain SMTPSES, Postmark or Mailgun: just change the SMTP settings

Everything that holds our logic or data can move. Amazon supplies the machine and the backup bucket.

Lightsail or EC2?

Lightsail start here

  • One flat price, IPv4 and 3 TB transfer included
  • Simple console, built-in snapshots and firewall
  • Can move to EC2 later from a snapshot

Limits: fixed plan sizes, and fewer AWS integrations, which we don't need.

EC2

  • Any size, ARM (Graviton) or Intel
  • Full networking: security groups, IAM roles for S3
  • Savings plans bring the price down ~30–40%

Costs: more settings to get right. The IP, disk and transfer are billed separately.

Either way the app is the same Docker Compose setup. Choosing Lightsail now doesn't lock anything in.

CloudFront: helpful, but not on day one

What it adds

  • Serves hero pictures and scripts from nearby edges
  • Free tier: 1 TB and 10M requests a month
  • Basic DDoS protection in front of the server

What it complicates

  • Hides each player's real address behind Amazon's servers, which breaks "admin = my home IP" unless the app is taught CloudFront's address ranges
  • The sign-in cookie and the API must never be cached, so the cache rules need care

Later: put CloudFront in front of /static/ only. That's a cheap win with no login side effects.

Going live: the security checklist

The server

  • Firewall: only 80 and 443 open to the world
  • SSH: from your home IP only, or use AWS Session Manager (no open port)
  • Login: DOTAPICKER_AUTH=native, which is already built
  • Admin: DOTAPICKER_ADMIN_NETS = your home public IP

Keeping it healthy

  • OS updates: automatic security patches (unattended-upgrades)
  • Backups: Litestream to S3, plus a test restore once
  • Secrets: a .env on the server, never in git
  • Before a wide launch: email verification and password reset (SMTP)

Already done in the app: hashed passwords, HttpOnly/Secure cookies, login throttling, cross-site write blocking, and a spoof-proof client address.

How a deploy would work

git pushto GitLab
→
Build imageARM + Intel
→
RegistryGitLab or Docker Hub
→
Server pullsover SSH
→
Health check/health
# on the server, what "deploy" boils down to
cd /opt/dotapicker
docker compose pull            # the new image
docker compose up -d           # replaces the app container; Caddy and Litestream keep running
curl -fsS https://dotapicker.example/health

No AWS deploy service needed: the same steps would work on any Linux server. The GitLab registry keeps even the image storage off Amazon.

When would we outgrow one server?

1
server handles hundreds of players at once. The heavy work runs in their browsers.
2×
the first step up: a bigger plan, a few minutes of downtime, no code change
N
many servers: Postgres, a shared session store, and a load balancer. Only when it's needed.

Start with the simplest thing that is safe. The path to scale stays open, and we only pay for it once we need it.

Decisions for you

1 · Lightsail or EC2

Recommended: Lightsail 2 GB (~$12). Flat price, simplest.

2 · Domain name

Which name players will use, and where its DNS lives (any registrar works).

3 · Region

Closest to most players. us-east-1 is cheapest and has the most services.

4 · CloudFront now or later

Recommended: later, and for /static/ only.

5 · Email provider

For verification and resets, over SMTP so it stays swappable. SES is cheapest; Postmark is simplest.

6 · Registry

GitLab's own registry (no Amazon) or ECR (Amazon). Recommended: GitLab.

Recommendation

One small server.
Same container.
Backups to S3.

About $12–17 a month, not tied to Amazon beyond S3, and running the same container you're testing on MODEL today. Next step once MODEL checks out: an AWS compose file (app, Caddy, Litestream), a settings template, and a one-command deploy.