Self-Hosting Foundations

Take a blank Ubuntu VPS to a server that runs containerised applications safely: firewalls that cover Docker, a real deployment, restorable backups, and a pipeline that ships changes.

Beginner vps 4 hr 8 lessons

This path assumes you can use a shell and nothing else. It ends with a server that runs real workloads, is backed up, and is deployed to from CI rather than from your laptop.

The order matters more than usual here. The firewall article comes first because the Docker port-publishing behaviour it covers invalidates the mental model most people bring from non-container hosts — and every later article assumes you know about it.

Budget four hours in total, spread over a few sessions. The two long ones are the deployment article and the backup article, and the backup article is the one people skip and regret.

Lessons

Read in order. Ticking a lesson stores your progress in this browser only.

  1. Lesson 1

    Harden the host

    SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

    Start here. The firewall behaviour covered in this article affects every later step.

    Intermediate · 4 min

  2. Lesson 2

    Attach a domain

    Create the A record, pick the right proxy status, set the SSL mode to Full (strict) and lock the origin so only Cloudflare can reach it — plus what errors 521, 522, 525 and 526 actually mean.

    DNS, proxy status and TLS termination before you deploy anything real.

    Beginner · 4 min

  3. Lesson 3

    Deploy a real application

    A production n8n install on Ubuntu 24.04 using Docker Compose, PostgreSQL and Caddy for automatic TLS — with the encryption key, webhook URL and backup steps most quickstarts leave out.

    A three-service Compose stack with a database and automatic certificates.

    Intermediate · 5 min

  4. Lesson 4

    Make it recoverable

    A nightly backup for a self-hosted Docker host: database dumps taken with the right tools, file volumes snapshotted with restic, a systemd timer to run it, and a restore test that proves it works.

    Database dumps and volume snapshots on a systemd timer, with a restore test.

    Intermediate · 4 min

  5. Lesson 5

    Diagnose resource limits

    Diagnose which file descriptor limit you actually hit — container, daemon or kernel — then raise it properly, and work out whether the real problem is a leak rather than a limit.

    The first operational failure most self-hosted stacks hit.

    Intermediate · 4 min

  6. Lesson 6

    Decide whether you want a platform

    Both put a Heroku-style deploy UI on your own VPS, but on different container primitives. What that means for zero-downtime deploys, multi-server growth and the day the control plane breaks.

    Optional. Read it when one Compose file has become five.

    Intermediate · 6 min

  7. Lesson 7

    Deploy without dropping requests

    Dokploy runs apps as Docker Swarm services, so rolling updates are already there — they just need a real health check and an update policy. Plus how to prove no request was dropped.

    Health checks and rolling update policy.

    Advanced · 4 min

  8. Lesson 8

    Automate the deploy

    Test, build a container image, push it to GHCR and deploy it to a VPS over SSH — with the concurrency guard, environment approval and token scoping that keep the pipeline from becoming the weak point.

    Build once in CI, deploy the exact image you tested.

    Intermediate · 4 min

All guides in this path

  • Security intermediate

    How to Secure a VPS That Runs Docker Containers

    SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

    4 min
  • Cloudflare beginner

    How to Point a Cloudflare Domain at Your VPS

    Create the A record, pick the right proxy status, set the SSL mode to Full (strict) and lock the origin so only Cloudflare can reach it — plus what errors 521, 522, 525 and 526 actually mean.

    4 min
  • n8n intermediate

    How to Deploy n8n on an Ubuntu VPS with Docker

    A production n8n install on Ubuntu 24.04 using Docker Compose, PostgreSQL and Caddy for automatic TLS — with the encryption key, webhook URL and backup steps most quickstarts leave out.

    5 min
  • Docker intermediate

    How to Back Up Docker Volumes Automatically

    A nightly backup for a self-hosted Docker host: database dumps taken with the right tools, file volumes snapshotted with restic, a systemd timer to run it, and a restore test that proves it works.

    4 min AI-assisted
  • Docker intermediate

    Dokploy vs Coolify: Choosing a Self-Hosting Platform

    Both put a Heroku-style deploy UI on your own VPS, but on different container primitives. What that means for zero-downtime deploys, multi-server growth and the day the control plane breaks.

    6 min AI-assisted
  • DevOps intermediate

    How to Build a GitHub Actions Deployment Pipeline

    Test, build a container image, push it to GHCR and deploy it to a VPS over SSH — with the concurrency guard, environment approval and token scoping that keep the pipeline from becoming the weak point.

    4 min AI-assisted