Deployn
Blog

Docker and Reverse Proxy: Your Path to Your Own Server

From VPS to Docker to reverse proxy: choose Caddy or Traefik, set up HTTPS, manage stacks with Komodo or Arcane and reach services behind DS-Lite with Pangolin.

Almost every guide on this blog starts in the same place: a Linux server, Docker and a reverse proxy that hands requests from the internet to the right containers. This guide puts the posts on that topic in order. It answers which server you need, which reverse proxy to pick and how to keep the containers under control afterwards.

The setup at a glance

A reverse proxy is the only service reachable directly from the internet. It accepts requests on ports 80 and 443, gets the HTTPS certificates and forwards each domain to the matching container. The apps themselves stay in an internal Docker network and need no open ports of their own.

Layer Job Post
Server Linux, updates, users, SSH keys, firewall VPS for beginners
Docker containers, images, Docker Compose Docker for beginners
Reverse proxy HTTPS, domains, forwarding Caddy or Traefik
Management stacks, logs, updates in the browser Komodo or Arcane
Tunnel reachability without a public IPv4 Pangolin

Step 1: Prepare the server

Whether it’s a VPS or a mini PC at home, the first steps are the same: update the system, create your own user with sudo, set up SSH key login, disable password login and limit the firewall to the ports you need. VPS for beginners walks through it step by step.

On Hetzner Cloud you can do a large part of this while creating the server. The cloud-init generator builds a configuration with user, SSH key, UFW, Fail2ban and Docker. The “Caddy + Docker” preset opens only SSH, HTTP and HTTPS.

How different VPS offers compare in performance is in the VPS benchmark. Whether Debian or Ubuntu is faster for Docker is covered in the Docker benchmark.

Step 2: Install Docker

I install Docker from Docker’s official apt repository, not from the distribution’s packages. That gives you current versions and the Compose plugin. I run commands with sudo docker compose. The user does not join the docker group, because that group effectively means root access.

Docker for beginners explains images, containers, volumes and networks and starts a first web server. After that I create a folder with a compose.yaml for each app.

Step 3: Choose the reverse proxy

The two proxies I use in the guides differ mainly in how you configure them:

Caddy Traefik
Configuration one file, the Caddyfile labels on the containers plus static configuration
HTTPS automatic, nothing to add automatic via a certificate resolver
Adding an app two lines in the Caddyfile, then reload labels in the app’s compose.yaml
Fits if you want everything in one place you run many stacks that should register themselves
Guide Caddy reverse proxy with Docker Set up Traefik 3

To start with, I recommend Caddy. The Caddyfile is short, and mistakes stand out when you read it. Build the skeleton with the Caddyfile generator. It has templates for Paperless-ngx, Immich, Vaultwarden, Nextcloud, Pocket ID with oauth2-proxy, Actual Budget, Forgejo and Open WebUI.

Traefik shows its strength when you roll out many stacks through an interface like Komodo. Each stack brings its labels, and Traefik picks them up without you touching a central file. Many older posts here use Traefik, for example for n8n, Plausible or Ghost.

Nginx Proxy Manager vs. plain Nginx

Nginx Proxy Manager (NPM) is an application that generates Nginx configuration from a web form and manages Let’s Encrypt certificates. Use it if you want to add hostnames, change where they point, and manage certificates in a browser. Plain Nginx reads the configuration files you supply. Use it if you already deploy from Git, want to review changes as diffs, or need direct control over Nginx directives and certificate renewal.

Both examples send https://demo.example.com to http://demo:80 on a shared Docker network and redirect visitors from HTTP to HTTPS. Replace demo.example.com with a hostname that points to your server. Run one proxy at a time because both publish TCP ports 80 and 443. The demo container stays on the proxy network without a published port.

Terminalbash
sudo docker network create proxy
sudo docker run -d --name demo --network proxy nginx:stable-alpine

Nginx Proxy Manager in the browser

Save this compose.yaml in a directory for NPM and run sudo docker compose up -d there. The admin interface listens on the server’s loopback address. Open an SSH tunnel from your computer with ssh -N -L 127.0.0.1:8181:127.0.0.1:81 deployn@SERVER_IP, then visit http://127.0.0.1:8181.

npm/compose.yamlyaml
services:
    npm:
        image: jc21/nginx-proxy-manager:2.17.1
        restart: unless-stopped
        ports:
            - "80:80"
            - "443:443"
            - "127.0.0.1:81:81"
        volumes:
            - ./data:/data
            - ./letsencrypt:/etc/letsencrypt
        networks:
            - proxy

networks:
    proxy:
        external: true

In Hosts → Proxy Hosts → Add Proxy Host, enter demo.example.com under Domain Names, choose http as the Scheme, set Forward Hostname / IP to demo, and set Forward Port to 80. On the SSL tab, request a new Let’s Encrypt certificate, enable Force SSL, and save. For the default HTTP-01 validation, the hostname must reach NPM on public TCP port 80.

Plain Nginx in configuration files

In a separate directory, save compose.yaml and conf.d/demo.conf. Before starting Nginx, copy the certificate chain and matching private key for your hostname to tls/fullchain.pem and tls/privkey.pem. For example, use Certbot with a DNS plugin to issue a Let’s Encrypt certificate before the proxy is listening. Mounting the directories lets Nginx read replacement files on reload.

nginx/compose.yamlyaml
services:
    nginx:
        image: nginx:stable-alpine
        restart: unless-stopped
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - ./conf.d:/etc/nginx/conf.d:ro
            - ./tls:/etc/nginx/tls:ro
        networks:
            - proxy

networks:
    proxy:
        external: true
nginx/conf.d/demo.confnginx
server {
    listen 80;
    server_name demo.example.com;
    return 301 https://demo.example.com$request_uri;
}

server {
    listen 443 ssl;
    server_name demo.example.com;
    ssl_certificate /etc/nginx/tls/fullchain.pem;
    ssl_certificate_key /etc/nginx/tls/privkey.pem;

    location / {
        proxy_pass http://demo:80;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
}

Run sudo docker compose up -d. After a config change, run sudo docker compose exec nginx nginx -t && sudo docker compose exec nginx nginx -s reload from the directory with compose.yaml. Use the same command in your certificate renewal workflow after it installs the renewed files in tls/. Keep tls/ out of version control.

With either proxy, curl -fsSL http://demo.example.com/ should follow the redirect, validate the certificate, and return the demo container’s Nginx welcome page. The main maintenance difference is where the configuration lives. Back up data/ and letsencrypt/ with NPM. With plain Nginx, version the Compose and .conf files and maintain certificate issuance and renewal separately. NPM setup guide · Nginx HTTPS configuration

Does speed matter?

Hardly. In the reverse proxy benchmark 2026 I measured Caddy, Traefik, Nginx Proxy Manager and Zoraxy on Hetzner servers with 1 and 4 vCPU. Under normal load all four are equally fast. On a single-core server, Caddy, NPM and Zoraxy answer 1,500 requests per second in under 2 ms at P95. The differences are in memory (Caddy 13 MB idle, Zoraxy 104 MB) and in a limit of Nginx Proxy Manager’s default installation that one line in the Compose file removes.

If you prefer a web interface over a config file, the benchmark 2025 compares Nginx Proxy Manager, NPM+ and Zoraxy.

Step 4: Manage stacks

With a few apps, SSH and sudo docker compose are enough. Beyond a handful of stacks, a web interface helps:

  • Komodo manages stacks through its interface or from a Git repository and has procedures for backups, automatic updates and additional servers. With Traefik, Komodo and two stacks, memory was around 1 GB in my test; for Komodo and Traefik alone I plan about 750 MB.
  • Arcane is leaner: edit Compose stacks in the browser, read logs, update images, back up volumes.

Before you share a Compose file or a log in a forum or issue, run it through the masker. It replaces passwords, tokens, domains and IP addresses with placeholders and keeps public registries such as ghcr.io.

Step 5: Reach services at home

Many internet connections no longer have a public IPv4 address (DS-Lite). Then you can’t forward ports on the router. The fix is a small VPS as a bridge: Pangolin runs on the VPS, and the Newt client on your home server opens a WireGuard tunnel outwards. The guide is Bypass DS-Lite with Pangolin.

That way the data stays at home, and only the tunnel runs through the rented server.

Single sign-on for all apps

Once the reverse proxy runs, you can put one shared login in front of your apps. Pocket ID is an OIDC provider with passkeys. Apps with OIDC support such as Paperless-ngx, Actual Budget or Forgejo connect directly. Apps without their own login are protected with oauth2-proxy and forward_auth in Caddy; the template for it is in the Caddyfile generator.

Frequently asked questions (FAQ)

  • Do I need a VPS or is a home server enough? Both work. A VPS has a fixed public IP and is reachable from anywhere. A home server keeps the data at home but needs a public IPv4 or a tunnel like Pangolin.
  • Caddy or Traefik? Caddy if you want one short central config file. Traefik if many stacks should register themselves via labels. Performance doesn’t decide it.
  • Why not just open the apps’ ports? Then every app needs its own certificates and is reachable from the internet on its own. Behind the reverse proxy only one service is open, and HTTPS is handled in one place.
  • Do I have to add my user to the docker group? No. I use sudo docker compose. Members of the docker group can gain root access without a password.
  • Which ports does the firewall need to open? SSH, 80 and 443. For HTTP/3 also 443/udp. Pangolin additionally needs UDP ports for WireGuard.

Related Blog Posts for Docker and Reverse Proxy: Guide to Servers, Caddy, Traefik and Pangolin

Zoraxy with Docker Compose: Set Up Your First HTTPS Proxy Host

Run Zoraxy with Docker Compose, create an admin account over SSH, and route a public hostname to a private container with Let's Encrypt HTTPS.

Arcane for Docker: Manage Containers, Compose Stacks, and Updates

Install Arcane with Docker Compose and manage Docker from your browser. See the stack editor, container logs, image updates, volumes, and backups in action.

Caddy Reverse Proxy with Docker: Caddyfile, Load Balancing and Fail2ban

Set up Caddy as a reverse proxy for Docker: automatic HTTPS, Caddyfile syntax, load balancing with health checks, headers, IP filter, basic auth, error pages and Fail2ban.

Docker for Beginners: Install It, Run Containers, Understand Images

Learn Docker step by step: images and containers explained, installation on Debian and Ubuntu, your first web server, managing containers and updating Docker.

Install Pocket ID: Single Sign-On with Passkeys for Your Self-Hosted Apps

Install Pocket ID with Docker and Caddy and connect apps like Paperless-ngx, Actual Budget and Forgejo. With passkeys, groups and an nginx example.

Komodo with Traefik: Manage Docker Servers from a Web Interface

Install Komodo behind Traefik with HTTPS, deploy stacks from the interface and from Git, set up backups and auto-updates, and connect a second server. With screenshots, for beginners.

Reverse Proxy Benchmark 2026: Caddy, Traefik, Nginx Proxy Manager and Zoraxy Compared

How many users can a reverse proxy handle on a small VPS? Caddy, Traefik, Nginx Proxy Manager and Zoraxy tested with 1 and 4 vCPU, real HTTPS certificates and charts.

Set Up Traefik 3: Reverse Proxy with Docker, HTTPS and Authentication

Traefik 3 as a reverse proxy for Docker: prepare the server, set up a domain, automatic Let's Encrypt certificates, middlewares, basic auth and Google login. Step by step for beginners.

Reverse Proxy Benchmark 2025: NPM vs. NPM+ (HTTP/3) vs. Zoraxy

Performance benchmark: Nginx Proxy Manager vs. NPM+ (HTTP/3) vs. Zoraxy. Discover which reverse proxy is the fastest and easiest for your self-hosted setup.

VPS for Beginners: Your Guide to Choosing and Securing

Choose and secure your first VPS step-by-step: system updates, new user, SSH keys, and firewall setup. The ideal starting point for self-hosting with Docker.

Bypass DS-Lite: Reverse Proxy with Docker & Pangolin

Learn how to bypass DS-Lite with a tunnel and make your local services accessible via a reverse proxy using Docker and Pangolin. Complete step-by-step guide.