Previous Page

nihilist - 00 / 00 / 00

Nginx Proxy Manager (Docker)

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

You can use DuckDNS to get a free domain name:

[ ] [ /dev/pts/13 ] [~/Nextcloud/blog/Conf]
→ ssh
The authenticity of host ' (' can't be established.
ECDSA key fingerprint is SHA256:z2HAncB99pfbAUfj9tJY7vlo8EGUzCIUxWBAnjAflcA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ',' (ECDSA) to the list of known hosts.
Linux debian-s-1vcpu-1gb-lon1-01 4.19.0-10-cloud-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Docker Installation

apt install curl -y
curl -fsSL -o 
apt install docker-compose -y

apt install docker-compose -y

which docker && docker -v

Next create nginxproxymanager (npm)'s directory and get the configuration files:

mkdir nproxy 
cd nproxy
nano config.json

    "database": {
            "engine": "mysql",

Hit ctrl+S to save and ctrl+X to exit nano, then create docker-compose.yml

nano docker-compose.yml

version: '3'
    image: 'jc21/nginx-proxy-manager:latest'
      - '80:80'
      - '81:81'
      - '443:443'
      - ./config.json:/app/config/production.json
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    image: 'jc21/mariadb-aria:10.4'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'nothing'
	  - ./data/mysql:/var/lib/mysql

docker-compose up -d

Wait a bit for it to run:

Once it's done, run docker ps to see your running containers:

root@debian-s-1vcpu-1gb-lon1-01:~/nproxy# docker ps
CONTAINER ID        IMAGE                             COMMAND             CREATED             STATUS                    PORTS                                            NAMES
b9bcb6598f65        jc21/mariadb-aria:10.4            "/scripts/"   56 seconds ago      Up 54 seconds             3306/tcp                                         nproxy_db_1
bf2a4c279e3c        jc21/nginx-proxy-manager:latest   "/init"             56 seconds ago      Up 54 seconds (healthy)>80-81/tcp,>443/tcp   nproxy_app_1

you can verify it is working by visiting your website (here it's

And there you have it. Now from here go to the admin page on port 81 where you'll log in with the default credentials

Change the default admin credentials:

Then log out and back in again with your new credentials:

Next let's create a proxy host for this server, just to test if it's working.

 ip addr show docker0 | grep inet
	inet brd scope global docker0

So we're going to make sure that redirects to the server's INTERNAL ip address's port 81:

Next head over to the SSL tab:

Hit Save:

Once that's done, you'll see that we have been able to:

  1. create a subdomain to our website

  2. enable SSL for that subdomain thanks to letsencrypt

  3. Create the subdomain https on port 443 regardless of the original port

  4. set it's access to public

So let's test it:

With this done, you realize now that you can use nginx proxy manager in order to bring together multiple web applications regardless of their ports (wether it is 8080 or 80 or 9090 or 443 etc) and enable them out publicly from a private ip subnet, to nproxy's public interface as a subdomain with SSL enabled thanks to letsencrypt.

In other words, this is giving me ideas to run a proxmox server locally at home where i will be able to host my web applications in virtualised environments (wether it is on debian or windows or centos) and therefore being able to use nproxy to make them available publicly as a list of subdomains. This also works for external servers that are accessible through public ip addresses and/or through their respective domain names:


Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8

Contact: (PGP)