Live on a Domain
You'll put your app on a server you rent, under HTTPS on your own domain, with migrations, a backup you've restored, and five people using it.
About
A static site lives on a free host and can't break at 3 a.m. An app with a database can, and that's the move this badge makes: a small Linux server you rent, your app running on it as a service, a database that survives deploys, and a backup you have actually restored rather than assumed. The cheap route is a 4 to 6 dollar a month virtual server from Hetzner, DigitalOcean or the like, or a free tier from Fly.io or Render while you learn. A platform that hides the server is fine to start with, but somewhere in this badge you need to ssh in and see the process yourself. With five people using it there's no reset button any more, which is the point. Running servers in your own house for your household is Homelab & Hardware; this one faces the internet.
At a glance
- Per requirement
- 35 XP
- Completion bonus
- 300 XP
- Requirements
- 6
- Takes
- One month
- Skill level
- Advanced (years of practice)
- Cost
- Inexpensive (under $20)
- Supplies
- You need some
- Where
- At home
- Other people
- With other people
Requirements
-
1
Rent a server and lock the door behind you. Create the smallest Linux server on offer, log in with an SSH key, turn off password login, make a non-root user, enable the firewall with only ports 22, 80 and 443 open, and switch on automatic security updates. Do this before the app goes on, because bots start knocking within minutes of a server getting an address. Take a screenshot of the firewall status and the sshd line that disables passwords. Photo
-
2
Run the app as a service that comes back after a reboot. A systemd unit or your platform's equivalent, with the app's secrets in an environment file that isn't in the repository. Reboot the server and watch the app come back without you touching it. Take a screenshot of the service status after the reboot with the uptime showing. Photo
-
3
Put it under HTTPS on your domain behind a reverse proxy. Point a subdomain or your main domain at the server, put Caddy or nginx in front of the app, and get a free certificate from Let's Encrypt, which Caddy does on its own. Check that http redirects to https and that the certificate renews itself. Take a screenshot of the padlock with the certificate expiry. Photo
-
4
Deploy a change that alters the database with a migration. Add a column or a table with a migration file that's checked in, run it on the server, then ship the code that uses it. The order matters: migrate first for a new nullable column, code first for a removal, or someone gets an error in between. Film the deploy from push to the new feature loading on the live site. Video
-
5
Back up the database on a schedule and restore it somewhere else. A nightly job that dumps the database and copies it off the server, to object storage or another machine. Then take last night's file, restore it on your laptop or a fresh server, and log in to the restored copy. A backup you haven't restored is a guess. Film the restore and the login to the copy. Video
-
6
Get five people signed up, and tell them what you keep. Friends count here; strangers come at the next tier. Put up a short page saying what you store, who can see it and how to delete an account, and make the delete work all the way down to the database. Take a screenshot of the users table or admin view showing five accounts with the emails hidden. Photo