Back to Blog
self-hostingdockerdevopstutorial

Zero to Production: Self-Hosting Your Stack on a $6/mo VPS

I

InfraPilot Team

January 15, 2026

Why Self-Host?

Managed cloud platforms are convenient — until the bill arrives. A modest SaaS product running on AWS, GCP, or Azure can easily cost $200–$500/mo for infrastructure that a single $6/mo VPS could handle. Self-hosting isn't about being cheap; it's about maintaining control over your data, your costs, and your architecture.

This guide walks through the exact setup we use internally at InfraPilot: a single Linux VPS, Docker Compose, Nginx, and automated SSL — all monitored in real time.

What You Need

  • A Linux VPS (Ubuntu 22.04 or Debian 12 recommended) — any provider works
  • A domain name pointed at your server's IP
  • SSH access and about 30 minutes

Step 1 — Install Docker

The official Docker convenience script handles everything:

curl -fsSL https://get.docker.com | sh
systemctl enable --now docker

Verify it's running with docker info. Add your user to the docker group to avoid prefixing everything with sudo:

usermod -aG docker $USER && newgrp docker

Step 2 — Structure Your Project

We recommend a single directory per project with a docker-compose.yml and a .env file. Keep secrets in the env file and never commit it to version control.

mkdir -p ~/apps/myapp && cd ~/apps/myapp
cp .env.example .env
nano .env  # fill in your values

Step 3 — Nginx & SSL with InfraPilot

Install InfraPilot to manage your Nginx configuration and SSL certificates visually:

curl -fsSL https://infrapilot.sh/install.sh | bash

Open the dashboard, add a reverse proxy pointing to your app container on its internal port, and enable Let's Encrypt. Certificate issuance and renewal happen automatically — no cron jobs, no certbot commands.

Step 4 — Monitor Everything

With InfraPilot running, you get real-time CPU, memory, and network graphs for every container. Set up alerting under Settings → Alerts so you're notified by email if any container crashes or exceeds thresholds.

Total Cost

A Hetzner CX22 (2 vCPU, 4 GB RAM) runs about €4.35/mo and can comfortably host 5–10 small-to-medium services. With InfraPilot's Community license (free), your entire production monitoring stack costs you nothing extra.

Self-hosting doesn't mean flying blind. It means flying cheaper, with full visibility.