Install NGINX Proxy Manager on a Raspberry Pi

by Bret
Published: Last Updated on 3 minutes read

After spending a little while playing around with the various Docker options 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 image 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 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, you’ll have a working instance of NGINX Proxy Manager running on your Raspberry Pi in no time.

Required files for NGINX Proxy Manager

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 see no errors, that’s it, you’re done!

If you’re also looking for another Docker container to run. Check out my guide on setting up Dynamic DNS with Cloudflare.

You may also like...

10 comments

Brandon 24/05/2020 - 00:33

Thanks so much! I was getting that error on my Pi 3. Great find! Got mine up and running :)

Reply
bret 28/05/2020 - 15:59

Hey Brandon, awesome – glad to hear this helped!

Reply
Carlos 29/05/2020 - 06:54

Hi.
A have error :
ERROR: In file ‘./docker-compose.yml’, service must be a mapping, not a NoneType.

Raspbian / Pi4

Reply
bret 29/05/2020 - 10:55

Hey Carlos! It sounds like you may have modified the indentation whilst adding in your own details so I’d recommend double checking that. If you want to post your docker-compose.yml file to pastebin and reply with a link to it I can take a look for you :)

Reply
Walmer 20/06/2020 - 05:20

Hello Bret,

I have the same error as Carlos, I did touch anything in your posted code. Just changed in the mariadb section the path to
– /srv/dev-disk-by-label-Files/Config/MariaDB:/var/lib/mysql
everything else including the json file are the same.

Could you please help me, I have weeks trying to put Ngnix Proxy manager on my pi 4. is good to mention that I am running Raspberry Pi OS (32-bit) Lite Minimal image based on Debian Buster that the offiacial web provides

Reply
bret 20/06/2020 - 11:47

Hey! Could you throw your exact file in a pastebin somewhere and link to it here? The error usually means that something isn’t formatted quite right so it’s possible going between the article and your text editor caused something to get modified slightly but I’ll take a look if you can show me what you have!

Reply
Walmer 22/06/2020 - 07:00
Reply
Bret 22/06/2020 - 09:15

It looks like the message has come through blank here, perhaps you could send the link etc via the contact form and I’ll take a look at it there!

Reply
Pat 17/08/2020 - 18:49

Fantastic, helped me, thanks

Reply
Bret 17/08/2020 - 19:43

Awesome, I’m glad to hear it! :D

Reply

Leave a Comment