I'm using Nginx Proxy Manager to manage reverse proxies. This provides a nice UI for Nginx reverse proxy configuration. There are other reverse proxy solutions that can do the same thing, like HA-proxy and Traefik.
The prerequisites for this to work are:
- You have set up a DNS A record (IPv4) for your site with a public DNS service (
yoursite.yourdomain.tld
)
- You have set up Docker on your VPS (including Docker Compose)
Installation and configuration:
The installation Nginx Proxy Manager as I have configured it are detailed here.
Basically you create a docker-compose.yml
file like this - inside the directory where you want your persistent data to be (mine is /mnt/docker-data/nginx-proxy-manager
):
version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
environment:
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
DB_MYSQL_PASSWORD: "npm"
DB_MYSQL_NAME: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: 'jc21/mariadb-aria:latest'
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
volumes:
- ./data/mysql:/var/lib/mysql
Where you can tweak the following:
'81:81' # Admin Web Port
: Change to '9999:81
if you want port 9999 exposed to the outside instead of port 81 for the admin interface.
- You can change the MYSQL user and password to your liking.
When your .yml
is done, run: (Docker Compose V2)
docker compose up -d
Or for the old version: (Docker Compose V1)
docker-compose up -d
Now go to ip.of.your.vps:9999
(if you changed the admin port to this), and login with the default user:
Email: admin@example.com
Password: changeme
You'll have to change this information.
Now, create a new proxy host, and you'll be greeted with a window like this:

Enter the following:
- In "Domain Names" enter the FQDN that is setup with DNS (in my example
yoursite.yourdomain.tld
)
- In "Scheme" enter
HTTP
(because you forward to HTTP/Port 80)
- In "Forward Hostname" enter the IPv6 address of your home machine
- In "Forward Port" enter
80
Click "Save".
In addition, you can set up a SSL Certificate for the site (using the built-in Let's Encrypt function), so you can use HTTPS on port 443 on the VPS.
The benefits of this solution:
- Nice graphical UI
- All configuration (forwarding, certificate etc.) managed in a single interface
- Flexible, you can use it for other sites as well (reverse proxy is filtering on subdomains)
The challenges of this solution:
- Requires additional setup for DNS, Docker and the container itself
- Might be overkill if you ever only need this single site