If you run more than one service on your homelab, you have probably hit the same wall: everything wants port 80 and 443, and remembering http://nas.local:8080 is not exactly a pleasant experience. A reverse proxy fixes this by putting a single, smart front door in front of all your services. Nginx is the industry-standard engine for this job, but editing raw Nginx config files by hand is fiddly and easy to break.

Nginx Proxy Manager (NPM) wraps Nginx in a clean web interface so you can add proxy hosts, request free Let’s Encrypt certificates, and manage subdomains with a few clicks. In this guide we will deploy it with Docker Compose, secure the admin panel, route your first service through it, and automate certificate renewal. Everything here runs on an ordinary home server, a small VPS, or a Raspberry Pi.

Why Use a Reverse Proxy at All?

A reverse proxy accepts incoming HTTP(S) requests from the internet and forwards them to the correct internal service. From the outside, one machine appears to serve everything. Inside, your services keep running on their own ports and hostnames.

The practical benefits are significant:

  • One entry point. Only ports 80 and 443 need to be exposed. Your internal apps can stay bound to localhost or a private Docker network.
  • Clean URLs. Replace 192.168.1.20:32400 with plex.example.com.
  • Free HTTPS. Let’s Encrypt certificates terminate at the proxy, so even services that do not support TLS get encrypted connections.
  • Extra control. Access lists, rate limiting, custom headers, and redirects all live in one place.

Nginx Proxy Manager is essentially a friendly control panel over Nginx plus a few helper tools. It stores configuration in a SQLite database and generates the underlying Nginx config for you.

What You Will Need

Before starting, make sure you have:

  1. A machine running Docker and Docker Compose (a Linux VPS or always-on home server).
  2. Ports 80 and 443 free and forwarded from your router if you want external access.
  3. A domain name you control, with access to its DNS settings.
  4. Basic familiarity with the command line.

For the DNS part, create an A record (or AAAA for IPv6) pointing a domain such as homelab.example.com at your server’s public IP. If you want individual subdomains, a wildcard record *.example.com pointing to the same IP saves a lot of repetitive work.

Step 1: Create the Project Structure

Make a dedicated directory so the stack is easy to back up and move later:

mkdir -p ~/nginx-proxy-manager && cd ~/nginx-proxy-manager
mkdir -p data ssl

The data folder will hold the SQLite database and Nginx configuration. The ssl folder stores your certificates and the Let’s Encrypt challenge files. Keeping both as bind mounts (rather than anonymous volumes) makes backups straightforward.

Step 2: Write the Docker Compose File

Create a docker-compose.yml with the following content:

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginx-proxy-manager
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./ssl:/etc/letsencrypt
    environment:
      DB_SQLITE_FILE: "/data/database.sqlite"
      DISABLE_IPV6: 'true'

A few notes on this configuration:

  • Port 80 handles HTTP traffic and the Let’s Encrypt HTTP-01 challenge.
  • Port 443 handles HTTPS traffic.
  • Port 81 is the admin interface. Keep it on your LAN or restrict it with your firewall; do not expose it publicly.
  • DISABLE_IPV6 avoids certificate failures on systems where IPv6 is not fully configured. Remove it if your IPv6 setup is solid.

Bring the container up:

docker compose up -d

Then follow the logs until it is ready:

docker compose logs -f app

Step 3: Log In and Change the Defaults

Open http://<server-ip>:81 in a browser. The default credentials are:

Email:    [email protected]
Password: changeme

You will immediately be prompted to change both. Use a strong, unique password and a real email address — Let’s Encrypt uses it to warn you about expiring certificates. This step is not optional; leaving the defaults is one of the most common ways a homelab gets compromised.

Step 4: Add Your First Proxy Host

Assume you have a service running on the same Docker host at port 3000. In the NPM interface:

  1. Go to Hosts → Proxy Hosts and click Add Proxy Host.
  2. On the Details tab, set the domain name (for example app.example.com).
  3. Set Scheme to http, Forward Hostname/IP to the container name or 127.0.0.1, and Forward Port to 3000.
  4. Tick Block Common Exploits for a bit of extra protection.
  5. Save.

If your target service runs in a different Docker Compose project, put both containers on a shared external network and reference the target by its container name. This is cleaner and more secure than publishing the target port on the host:

docker network create proxy-net

Then add proxy-net as an external network in each Compose file.

Step 5: Request a Free SSL Certificate

Edit the proxy host you just created and open the SSL tab. Under SSL Certificate, select Request a new SSL Certificate. Enter your email, agree to the Let’s Encrypt terms, and enable Force SSL and HTTP/2. Save, and NPM will perform the HTTP-01 challenge.

For this to work, the domain must already resolve to your server’s public IP and ports 80/443 must be reachable from the internet. If validation fails, the usual causes are a wrong DNS record, a closed port, or a CDN sitting in front of the domain.

If you use Cloudflare and prefer DNS validation — which also allows wildcard certificates — install the dns-cloudflare plugin inside the container and add a wildcard domain like *.example.com plus example.com. Wildcard certificates are ideal when you expect many subdomains.

NPM renews certificates automatically. It runs a scheduled task inside the container and swaps in the new certificate before the old one expires, so you do not need a cron job of your own.

Step 6: Harden the Setup

A reverse proxy is a public-facing component, so spend a few minutes locking it down:

  • Keep port 81 private. Use a firewall rule or your router so only your LAN can reach the admin panel. Better still, put it behind a VPN.
  • Enable 2FA. Recent NPM versions support two-factor authentication under your user profile.
  • Use access lists. For sensitive apps, create an Access List in NPM to require HTTP basic auth before a request ever reaches the backend.
  • Add security headers. The Advanced tab of a proxy host lets you inject headers such as Strict-Transport-Security, X-Content-Type-Options, and Referrer-Policy. There are well-known snippets you can paste in.
  • Stay updated. Pull new images periodically with docker compose pull && docker compose up -d. Read release notes before major jumps.

Backups and Restoration

Because configuration lives in two folders, a backup is simple. Stop the container, then archive thedata and ssl directories:

tar czf npm-backup-$(date +%F).tar.gz data ssl

Store that archive somewhere off-machine. To restore on a new host, recreate the folder structure, unpack the archive, and start the stack again — your proxy hosts and certificates come back with it.

Common Troubleshooting Tips

  • 502 Bad Gateway: The proxy cannot reach the backend. Check that the target container is running and that the hostname and port are correct. If both are in Docker, confirm they share a network.
  • Certificate issuance fails: Verify DNS points to the right IP, ports 80/443 are open, and no other service is binding those ports. Check the container logs for the exact ACME error.
  • Admin panel unreachable: Confirm you are using port 81 and that no firewall is blocking it.
  • Changes not taking effect: NPM reloads Nginx on save, but a docker compose restart resolves stubborn cases.

Final Thoughts

Nginx Proxy Manager removes most of the pain from self-hosting multiple services. You get a polished UI, free automated HTTPS, and a single, well-understood place to manage routing — without ever hand-editing an Nginx config. Once it is running, adding a new service is a two-minute job, and your homelab starts to feel like a coherent platform rather than a pile of ports.

Pair it with a good backup routine and sensible access controls, and it becomes a reliable foundation you can build on for years.