Reverse Proxy Manager on Raspberry Pi

I was looking for some time to easily manage the binding of multiple web application hosted in my docker host machine. I have found a good candidate in Nginx Proxy Manager from Jamie Curnow https://jc21.com

To best fit the installation, I rearranged the default setup for a fastest deploy in my environment based on PhotonOS and Portainer for Raspberry PI.

Base configuration

Open an ssh console and create a new folder where you store a configuration file. Note that “npm” means “Nginx Proxy Manager”.

mkdir /var/npm
nano /var/npm/config.json

Than paste the configuration parameters as follow.

{
  "database": {
    "engine": "mysql",
    "host": "db",
    "name": "npm",
    "user": "npm",
    "password": "npm",
    "port": 3306
  }
}

Enter into the Portainer UI, go to the Stacks menu and add a new stack.

Service stack creation

Choose a name for example “npm”, paste on the Web editor the script and deploy the stack.

version: "2"
services:
  app:
    image: jc21/nginx-proxy-manager:latest
    restart: always
    ports:
      # Public HTTP Port:
      - "80:80"
      # Public HTTPS Port:
      - "443:443"
      # Admin Web Port:
      - "81:81"
    volumes:
      # Make sure this config.json file exists as per instructions above:
      - /var/npm/config.json:/app/config/production.json
      - npm-data:/data
      - npm-letsencrypt:/etc/letsencrypt
    depends_on:
      - db
  db:
    image: mariadb:latest
    restart: always    
    environment:
      MYSQL_ROOT_PASSWORD: "npm"
      MYSQL_DATABASE: "npm"
      MYSQL_USER: "npm"
      MYSQL_PASSWORD: "npm"
    volumes:
      - npm-mysql:/var/lib/mysql

If all goes to the right way you should see your service up and healthy

Now you could proceed with the proxy configuration at the link http://<host-address>:81

Default credential

Email:    admin@example.com
Password: changeme

Complete your customization and good work!