All Articles

NGINX Proxy Manager on a Raspberry Pi

After spending a little while playing around with the various Docker options out there this evening I thought I’d put together the config.json and docker-compose.yml files that finally worked for me when trying to deploy a stack of containers for nginx proxy manager (I’m trying to play around with some reverse proxying on my local network whilst I use the quarantine/lockdown period to test new things!)

Using https://github.com/jlesage/docker-nginx-proxy-manager doesn’t seem to work (standard_init_linux.go:211: exec user process caused "exec format error" being the error) as it doesn’t have an ARM build and whilst the official one (https://nginxproxymanager.com/) grabbed everything, the database container was throwing a similar error to the 1st. Playing around with linuxserver’s MariaDB container wasn’t working too well either (migration file "20180618015850_initial.js" failed was the initial error and I could get past some permission errors with some manual intervention in the container but I don’t want to worry about that going forward..) and then I stumbled upon a Github user’s comment and whilst that didn’t work perfectly for me, a little tweaking led me to the below. With these together (make sure you change the database details in both so that they match!) you should be able to get a working instance of nginx-proxy-manager up and running on your Raspberry Pi (mine’s a Pi4).

config.json

{
"database": {
"engine": "mysql",
"host": "db",
"name": "DBNAME",
"user": "DBUSERNAME",
"password": "DBPASSWORD",
"port": 3306
  }
}

docker-compose.yml

version: "3"  
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:  
      - ./config.json:/app/config/production.json  
      - ./data:/data  
      - ./letsencrypt:/etc/letsencrypt  
  db:  
    image: yobasystems/alpine-mariadb:latest  
    restart: always  
    environment:  
      MYSQL_ROOT_PASSWORD: ROOTPASSWORD  
      MYSQL_DATABASE: DBNAME  
      MYSQL_USER: DBUSERNAME  
      MYSQL_PASSWORD: DBPASSWORD  
    volumes:  
      - /PATH/TO/CONTAINER/FILES:/var/lib/mysql  
    expose:  
      - "3306"

Once you have both of these in the same folder, use docker-compose up -d and let it run its course. If you get an error when using these, let me know what it is in the comments along with the OS/Raspberry Pi you’re running it on as I’d be curious to see what’s going wrong!