Full Byte Developer.

A boring production box: nginx, systemd, backups

One restorable VPS with nginx in front, a systemd unit for the app, and backups you have actually restored.

Published here , updated · 5 sources

A boring production box is one restorable VPS: nginx terminates HTTP, systemd keeps the app up, backups restore onto a clean machine. Climb later. Ladder neighbors: cloud complexity you do not need, Compose is enough longer, when you need Kubernetes.

Quick start (under a minute)

Draw three layers: browser to nginx on port 80 or 443, nginx proxy_pass to your app on a loopback port, app started by systemd with Restart=on-failure [1] [2].

If you cannot describe those three layers on one index card, pause before you add a fourth orchestration product.

Traffic path on one host

nginx's beginner guide: a master process reads configuration; worker processes handle connections; nginx -s reload applies a valid new config without dropping the pattern the guide documents [1].

Serve static assets with a root location when you can; proxy dynamic traffic to the app port [1]. Reload only after a config that parses; the guide treats a failed reload as a signal to fix the file before you touch production traffic again [1].

Put nginx in front

Minimal reverse-proxy shape from nginx proxy documentation referenced in the beginner guide [1]:

nginx
server {
    listen 80;
    server_name example.com;

    location /static/ {
        root /var/www/myapp;
    }

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Per nginx docs, test configuration before reload. On a host with nginx installed you would run nginx -t then nginx -s reload [1]. This draft host does not ship nginx in the image, so those commands are not reproduced here as observed output.

Run the app under systemd

systemd.service documents unit files that describe services: ExecStart runs the process; Type controls how readiness is judged (for many simple apps, simple or exec) [2]. A minimal sketch:

ini
[Unit]
Description=my app
After=network-online.target
Wants=network-online.target

[Service]
WorkingDirectory=/opt/myapp
ExecStart=/opt/myapp/.venv/bin/python -m myapp
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable and start with systemctl enable --now myapp.service on distributions that use systemd (paths and unit names vary). Read the unit's man page for User=, environment files, and hardening options before you invent flags [2].

Confirm systemd on this draft host

Observed on this draft host (systemd 255.4-1ubuntu8.18, 2026-12-03):

bash
systemctl --version | head -1
text
systemd 255 (255.4-1ubuntu8.18)

That version line is only proof this VM runs systemd, not that your VPS matches. Pin your own systemctl status yourapp.service output in your runbook after you deploy.

Prove backups with a restore drill

Checklist item that fails most audits: a restore you actually ran.

text
  RESTORE DRILL (write dates in your runbook)
  -------------------------------------------

  [ ] Inventory: app data, TLS material, nginx conf, unit files, env templates
  [ ] Off-box copy: object storage or second host (not the same disk)
  [ ] Blank VM: restore from backup, install nginx + unit, start app
  [ ] Smoke: curl health URL from outside; compare to pre-fail snapshot
  [ ] Record: who ran drill, ISO date, time to green

Name the backup tool in your private runbook; this page stays on the requirement, not a vendor recipe. Without step three, you have replication, not recovery.

Firewall and published ports

Default-deny inbound on the VPS firewall except SSH from your IP or tailnet, HTTP, and HTTPS to nginx. The app on 127.0.0.1:8000 should not accept the public internet directly. Providers differ on whether ufw, firewalld, or cloud security groups own that rule; pick one layer and document it in the same runbook as nginx.

Outbound rules matter less for a first boring box, but note if your app must reach a managed database or object storage so you can debug egress failures without guessing.

Operate without heroics

Automatic OS security updates belong on the box when your distro supports them safely. Still read maintenance mail from your provider. Disk alerts should page before the database does (cloud complexity you do not need names the one-VPS start).

Logs: nginx access and error logs plus journald for the unit (journalctl -u myapp.service -f per your distro docs). One aggregate health URL keeps external monitors dumb and cheap.

TLS: use your provider's documented path (Certbot, Caddy, or load balancer termination). nginx beginner material assumes you terminate TLS somewhere; do not publish port 8000 directly to the internet if the app is not built for that threat model.

Document renewal: who gets email from Let's Encrypt, which cron or timer runs renewal, and what command proves a cert still covers your apex and www hostnames. A boring box that serves HTTP on day ninety-one because renewal failed is still a production incident.

Hand off without folklore

Write a one-page runbook: provider login, DNS registrar, backup location, systemd unit name, nginx paths, and the health URL. Future you at 02:00 Dubai should not need chat scrollback. Link the runbook from the repo README or an internal doc, not from a Post-it on one laptop.

When a teammate joins, they clone the repo, read AGENTS.md or your Cursor rules if you use them, and follow the runbook to deploy to staging. Staging can be the same compose or unit files with different env files; the boring shape stays identical.

Stay boring until evidence says climb

One host with nginx, systemd, and tested backups is the documented first production shape for many apps. Compose on that host is still one machine (compose is enough longer). Multi-node triggers live in when you need Kubernetes.

Opinion with a reason: a boring box you can rebuild beats a clever cluster you cannot explain at 02:00 Dubai.

Mistakes that waste a week

Proxying without health checks. nginx will happily forward to a dead upstream until something else notices. Add app health checks or monitor the loopback port.

Reloading broken nginx config. Test with nginx -t before reload per nginx guidance [1]. A syntax error during reload can leave you in a worse state than before you edited.

Running the app as root because it was faster. Create a service user, tighten file permissions, and set User= in the unit when the man page allows it [2].

Backups that only live on the same volume. Disk failure then kills app and backup together. Off-box is the point.

Skipping the restore drill because snapshots exist. Snapshots help operators; restores help customers. Schedule the drill.

Jumping to Kubernetes because the résumé needs the word. Rewrite the résumé or wait for a measured trigger [5].

Schedule the restore drill on your calendar before you tune nginx worker counts. A passing health URL on a blank VM beats any architecture diagram. If the box stays healthy on one host, cloud complexity you do not need explains when extra control planes are vanity; multi-container on the same metal stays in Compose is enough longer. Pair weekly patches with developer security hygiene weekly so the VPS you rebuild is not the weak link in the repo.

Send this to the friend whose production box has no restore drill.

Internet-side teal disc arrow into a glass pyramid on a black box, with an orange path from a ringed cylinder past a teal-edged cube, plus dark key-like rods, no people.
nginx terminates HTTP, systemd runs the app, backups leave the disk.

Keep this guide

By Full Byte Developer

Filed under Dev tools, Dev explainers

Questions about this guide

What is a boring production box?

A single restorable server that serves traffic through a reverse proxy, runs the app under a process manager, and has backups you have tested on a clean machine. Complexity climbs only when that model fails in ways you can name.

Why nginx and systemd?

nginx's beginner guide covers static files and proxy_pass to an upstream. systemd.service documents how to declare a long-running unit with ExecStart and restart policy. Together they cover the common VPS shape without a cluster control plane.

When do I leave this shape?

When you need multi-node failover or fleet-wide rolling deploys under real load. That is the Kubernetes trigger list, not a resume keyword. Compose on one host is still boring until the host story breaks.

What counts as a real backup?

A copy you have restored onto a clean machine and used to serve traffic or pass an application health check. Untested snapshots are hope, not a checklist item.

Do I need Docker for a boring box?

No. A venv or static binary plus systemd is enough. Compose is optional layering on the same host when multiple containers help.

Sources

Next in this stack