[GH-ISSUE #2679] update for docker-compose setup exmaples #1844

Closed
opened 2026-02-26 07:32:42 +03:00 by kerem · 2 comments
Owner

Originally created by @ccppoo on GitHub (Mar 13, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2679

update for documentation's sample docker-compose.yaml

Describe the solution you'd like

example docker-compose.yaml script from documentation

uses mounting volume(folder) for database and npm folders.

but it's error prone because your sample script is using relative path ./data

that **./data** could cause error depending on where the user run docker-compose up -f /path/to/docker-compose.yml

if ./data already existed error bellow could happen (that most of the people asks at issue tab)

error example 1

ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.21.0.3' (using password: YES)

error example 2

error that shows bad gateway first login such as this issue

so solution

no one mentioned this issue because he solved his own problem and closed the issue

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1832

I saw other solutions at stackoverflow or reddit but

this was the most simple and safe from other side affect (which could be caused by editing config files)

it just adds docker volume (in my case external - so it could be safe when redeployed)

docker-compose.yaml I used and worked

version: "3"
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
      DISABLE_IPV6: 'true'
    volumes:
      - npm_system:/data #### change here ####
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db

  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - npm_system_db:/var/lib/mysql #### change here ####
  
#### change here ####
volumes:
  npm_system_db:
    external: true
  npm_system:
    external: true

just adding external docker volume

Originally created by @ccppoo on GitHub (Mar 13, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2679 ## **Is your feature request related to a problem? Please describe.** update for documentation's sample `docker-compose.yaml` ## **Describe the solution you'd like** example `docker-compose.yaml` script from [documentation](https://nginxproxymanager.com/setup/#using-mysql-mariadb-database) uses mounting volume(folder) for database and npm folders. but it's error prone because your sample script is using relative path `./data` that `**./data**` could cause error depending on where the user run `docker-compose up -f /path/to/docker-compose.yml` if `./data` already existed error bellow could happen (that most of the people asks at issue tab) ### error example 1 ``` ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.21.0.3' (using password: YES) ``` ### error example 2 error that shows **bad gateway** first login such as [this issue](https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2637) ## so solution no one mentioned this issue because he solved his own problem and closed the issue https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1832 I saw other solutions at stackoverflow or reddit but this was the most simple and safe from other side affect (which could be caused by editing config files) it just adds docker volume (in my case external - so it could be safe when redeployed) # `docker-compose.yaml` I used and worked ```yaml version: "3" services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' # Public HTTP Port - '443:443' # Public HTTPS Port - '81:81' # Admin Web Port environment: DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "npm" DISABLE_IPV6: 'true' volumes: - npm_system:/data #### change here #### - ./letsencrypt:/etc/letsencrypt depends_on: - db db: image: mysql command: --default-authentication-plugin=mysql_native_password restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - npm_system_db:/var/lib/mysql #### change here #### #### change here #### volumes: npm_system_db: external: true npm_system: external: true ``` just adding external docker volume
kerem 2026-02-26 07:32:42 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 26, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1911281097 --> @github-actions[bot] commented on GitHub (Jan 26, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Mar 12, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2716201296 --> @github-actions[bot] commented on GitHub (Mar 12, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1844
No description provided.