How to Set Up Nginx Proxy Manager on Raspberry Pi with Docker

How to Set Up Nginx Proxy Manager on Raspberry Pi with Docker

If you are running multiple services on your Raspberry Pi or across several devices on your home network, managing access to each one by IP address and port number gets tedious fast. Nginx Proxy Manager gives you a simple web-based interface to create reverse proxies, manage SSL certificates, and route traffic to your services using clean domain names.


What is Nginx Proxy Manager?

Nginx Proxy Manager (NPM) is a Docker-based reverse proxy with a built-in admin UI. It sits in front of your services and forwards incoming requests to the correct backend based on the domain name or subdomain. Key features include:

  • A clean web UI for managing proxy hosts
  • Built-in Let's Encrypt SSL certificate provisioning
  • Access list support for restricting who can reach your services
  • Support for WebSocket proxying
  • Stream (TCP/UDP) proxying for non-HTTP services

Prerequisites

Before you begin, make sure you have:

  • A Raspberry Pi (3B+ or newer) running Raspberry Pi OS
  • Docker and Docker Compose installed -- if you need help with this, see our Docker setup guide
  • A static IP address assigned to your Raspberry Pi
  • Ports 80 and 443 available (not used by another service)

Step 1: Create a Project Directory

Bash
mkdir ~/nginx-proxy-manager && cd ~/nginx-proxy-manager

Step 2: Create the Docker Compose File

Create a docker-compose.yml file in the project directory:

Bash
nano docker-compose.yml

Paste the following configuration:

YAML
version: '3.8'

services:
  app:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginx-proxy-manager
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "81:81"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

Port 80 handles HTTP traffic, port 443 handles HTTPS traffic, and port 81 is the admin web interface.


Step 3: Start Nginx Proxy Manager

Launch the container in detached mode:

Bash
docker-compose up -d

Wait about 30 seconds for the application to initialize, then verify it is running:

Bash
docker ps

You should see the nginx-proxy-manager container listed with all three ports mapped.


Step 4: Access the Admin Interface

Open your browser and navigate to:

Code
http://<your-pi-ip>:81

Replace <your-pi-ip> with the actual IP address of your Raspberry Pi. Log in with the default credentials:

  • Email: admin@example.com
  • Password: changeme

You will be prompted to change your email and password immediately after the first login. Choose a strong password and save it somewhere safe.


Step 5: Add a Proxy Host

Once logged in, click Hosts in the top menu, then Proxy Hosts, then the Add Proxy Host button. Fill in the form:

  • Domain Names: Enter the domain or subdomain you want to use (e.g., grafana.home.local)
  • Scheme: http
  • Forward Hostname / IP: The IP address of the service you are proxying (e.g., 192.168.1.50)
  • Forward Port: The port of the service (e.g., 3000 for Grafana)
  • Block Common Exploits: Toggle on
  • Websockets Support: Toggle on if the service uses WebSockets

Click Save and Nginx Proxy Manager will immediately begin routing traffic for that domain to your backend service.


Step 6: Request a Let's Encrypt SSL Certificate

If your Raspberry Pi is accessible from the internet (or you are using a DNS challenge), you can provision free SSL certificates directly from the admin UI.

  1. Edit an existing proxy host or create a new one
  2. Click the SSL tab
  3. Under SSL Certificate, select Request a new SSL Certificate
  4. Check Force SSL to redirect all HTTP traffic to HTTPS
  5. Enter your email address for Let's Encrypt notifications
  6. Agree to the Let's Encrypt Terms of Service
  7. Click Save

NPM will automatically handle certificate issuance and renewal. Certificates are renewed automatically before they expire.

For local-only setups where you do not have a public domain, you can use the DNS Challenge option with providers like Cloudflare, DigitalOcean, or DuckDNS. Select your DNS provider from the dropdown and enter the required API credentials.


Step 7: Updating Nginx Proxy Manager

To update to the latest version, navigate to your project directory and run:

Bash
cd ~/nginx-proxy-manager
docker-compose pull
docker-compose down
docker-compose up -d

Your configuration and certificates are stored in the data and letsencrypt volumes, so they persist across updates.


Troubleshooting

  • Cannot access port 81: Make sure no other service is using ports 80, 81, or 443. Check with sudo lsof -i :81.
  • 502 Bad Gateway errors: The backend service is unreachable. Verify the IP and port are correct, and that the target service is running.
  • SSL certificate request fails: Ensure ports 80 and 443 are forwarded from your router to the Raspberry Pi if you are using HTTP validation. For local-only setups, use the DNS challenge method instead.
  • Container won't start: Check the logs with docker logs nginx-proxy-manager for specific error messages.
  • Slow performance on older Pi models: Nginx Proxy Manager runs well on a Pi 3B+ or newer. On older models, you may experience slower response times under heavy traffic.

Conclusion

Nginx Proxy Manager makes it simple to manage reverse proxies and SSL certificates for all your self-hosted services. With its browser-based admin panel, you can add new proxy hosts, provision certificates, and manage access controls without touching a configuration file. It pairs well with any Docker-based service running on your Raspberry Pi network.