[GH-ISSUE #200] No-config databases or json data storage #177

Closed
opened 2026-02-26 06:31:09 +03:00 by kerem · 19 comments
Owner

Originally created by @Daemach on GitHub (Sep 13, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/200

FWIW, it would be nice to remove the need for database configuration, or an extra database, by using redis, couchbase, mongodb or other nosql databases, or better yet just store/persist the data in a json file that can be stored on a volume or NFS share. Configs will not change often enough to justify a full database with its added complexity and overhead.

Originally created by @Daemach on GitHub (Sep 13, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/200 FWIW, it would be nice to remove the need for database configuration, or an extra database, by using redis, couchbase, mongodb or other nosql databases, or better yet just store/persist the data in a json file that can be stored on a volume or NFS share. Configs will not change often enough to justify a full database with its added complexity and overhead.
kerem 2026-02-26 06:31:09 +03:00
Author
Owner

@talondnb commented on GitHub (Sep 23, 2019):

I agree with this, it becomes a bit of a pain having to launch the containers in certain order unless I'm missing something?

<!-- gh-comment-id:534059318 --> @talondnb commented on GitHub (Sep 23, 2019): I agree with this, it becomes a bit of a pain having to launch the containers in certain order unless I'm missing something?
Author
Owner

@bstin commented on GitHub (Oct 1, 2019):

A possible solution that may be quicker to implement is just base this around sqlite? That way the db and db-engine can just be part of same container and generally be invisible to user.

<!-- gh-comment-id:537005435 --> @bstin commented on GitHub (Oct 1, 2019): A possible solution that may be quicker to implement is just base this around sqlite? That way the db and db-engine can just be part of same container and generally be invisible to user.
Author
Owner

@meichthys commented on GitHub (Apr 26, 2020):

Has this been implemented? I can't seem to find any documentation or dev versions that have this.

<!-- gh-comment-id:619471757 --> @meichthys commented on GitHub (Apr 26, 2020): Has this been implemented? I can't seem to find any documentation or dev versions that have this.
Author
Owner

@timdonovanuk commented on GitHub (Jun 8, 2020):

+1 to this. A mysql database takes up 250mb+ to store the < 2kb of data required to make nginx-proxy-manager work. Absolutely nuts.

<!-- gh-comment-id:640541411 --> @timdonovanuk commented on GitHub (Jun 8, 2020): +1 to this. A mysql database takes up 250mb+ to store the < 2kb of data required to make nginx-proxy-manager work. Absolutely nuts.
Author
Owner

@renannprado commented on GitHub (Jun 27, 2020):

I was about to try it out, but requiring a database for this purpose is a no-go for me.

I'll try out this one https://github.com/schenkd/nginx-ui it seems it doesn't require a database.

<!-- gh-comment-id:650649926 --> @renannprado commented on GitHub (Jun 27, 2020): I was about to try it out, but requiring a database for this purpose is a no-go for me. I'll try out this one https://github.com/schenkd/nginx-ui it seems it doesn't require a database.
Author
Owner

@guiguid commented on GitHub (Jul 11, 2020):

+1 having mariadb for storing 99% of 10kb readonly data on embed devices make this powerfull software useless.
It also add more maintenance, less robustness, more attack surface.

<!-- gh-comment-id:657033080 --> @guiguid commented on GitHub (Jul 11, 2020): +1 having mariadb for storing 99% of 10kb readonly data on embed devices make this powerfull software useless. It also add more maintenance, less robustness, more attack surface.
Author
Owner

@meichthys commented on GitHub (Jul 11, 2020):

Most other containers that don’t need such a robust database use SQLite which exists in a single file and is quite reliable (even used by some major browsers).

Being able to migrate a single file (whether an SQLite dB or a JSON file would make things much easier when needing to migrate).

<!-- gh-comment-id:657060588 --> @meichthys commented on GitHub (Jul 11, 2020): Most other containers that don’t need such a robust database use SQLite which exists in a single file and is quite reliable (even used by some major browsers). Being able to migrate a single file (whether an SQLite dB or a JSON file would make things much easier when needing to migrate).
Author
Owner

@meichthys commented on GitHub (Jul 17, 2020):

@tg44 Do you know how we might be able to get a working instance using Sqlite?

<!-- gh-comment-id:660316529 --> @meichthys commented on GitHub (Jul 17, 2020): @tg44 Do you know how we might be able to get a working instance using Sqlite?
Author
Owner

@tg44 commented on GitHub (Aug 5, 2020):

Heads up to this thread; Sqlite works!

Example db config; github.com/tg44/nginx-proxy-manager@6690b7735d/backend/config/sqlite-test-db.json

<!-- gh-comment-id:669600058 --> @tg44 commented on GitHub (Aug 5, 2020): Heads up to this thread; Sqlite works! Example db config; https://github.com/tg44/nginx-proxy-manager/blob/6690b7735d494820a7c0fa243dda86157bceb282/backend/config/sqlite-test-db.json
Author
Owner

@meichthys commented on GitHub (Aug 6, 2020):

@tg44 Great news! I can't wait to try this!

<!-- gh-comment-id:669688403 --> @meichthys commented on GitHub (Aug 6, 2020): @tg44 Great news! I can't wait to try this!
Author
Owner

@meichthys commented on GitHub (Aug 15, 2020):

@tg44 Do you know what a sample docker compose would look like using SQlite?

<!-- gh-comment-id:674406334 --> @meichthys commented on GitHub (Aug 15, 2020): @tg44 Do you know what a sample docker compose would look like using SQlite?
Author
Owner

@tg44 commented on GitHub (Aug 15, 2020):

My currently working compose;

version: "3"
services:
  nginx-proxy-manager:
    image: jc21/nginx-proxy-manager:github-pr-510
    restart: unless-stopped
    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:
      - /hdd/docker/nginx-proxy-manager/config.json:/app/config/production.json
      - /hdd/docker/nginx-proxy-manager/data:/data
      - /hdd/docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt

And config json;

{
    "database": {
      "engine": "knex-native",
      "knex": {
        "client": "sqlite3",
        "connection": {
          "filename": "/data/mydb.sqlite"
        },
        "pool": {
          "min": 0,
          "max": 1,
          "createTimeoutMillis": 3000,
          "acquireTimeoutMillis": 30000,
          "idleTimeoutMillis": 30000,
          "reapIntervalMillis": 1000,
          "createRetryIntervalMillis": 100,
          "propagateCreateError": false
        },
        "migrations": {
          "tableName": "migrations",
          "stub": "src/backend/lib/migrate_template.js",
          "directory": "src/backend/migrations"
        }
      }
    }
}

I think using latest or github-develop tags should work too, and they are much safer to use than any pr tags.

<!-- gh-comment-id:674432404 --> @tg44 commented on GitHub (Aug 15, 2020): My currently working compose; ``` version: "3" services: nginx-proxy-manager: image: jc21/nginx-proxy-manager:github-pr-510 restart: unless-stopped 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: - /hdd/docker/nginx-proxy-manager/config.json:/app/config/production.json - /hdd/docker/nginx-proxy-manager/data:/data - /hdd/docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt ``` And config json; ``` { "database": { "engine": "knex-native", "knex": { "client": "sqlite3", "connection": { "filename": "/data/mydb.sqlite" }, "pool": { "min": 0, "max": 1, "createTimeoutMillis": 3000, "acquireTimeoutMillis": 30000, "idleTimeoutMillis": 30000, "reapIntervalMillis": 1000, "createRetryIntervalMillis": 100, "propagateCreateError": false }, "migrations": { "tableName": "migrations", "stub": "src/backend/lib/migrate_template.js", "directory": "src/backend/migrations" } } } } ``` I think using `latest` or `github-develop` tags should work too, and they are much safer to use than any pr tags.
Author
Owner

@meichthys commented on GitHub (Aug 16, 2020):

@tg44 Perfect. Thanks! This work for me too.
@Daemach I think we can close this issue.

<!-- gh-comment-id:674463808 --> @meichthys commented on GitHub (Aug 16, 2020): @tg44 Perfect. Thanks! This work for me too. @Daemach I think we can close this issue.
Author
Owner

@meichthys commented on GitHub (Sep 8, 2020):

@tg44 The SQLite configuration works great, however i'm having troubles requesting an SSL certificate. It seems to fetch the certificate correctly, but there seems to be an issue with an SQL datetime conversion. (See #584)

<!-- gh-comment-id:688591193 --> @meichthys commented on GitHub (Sep 8, 2020): @tg44 The SQLite configuration works great, however i'm having troubles requesting an SSL certificate. It seems to fetch the certificate correctly, but there seems to be an issue with an SQL datetime conversion. (See #584)
Author
Owner

@MrCaringi commented on GitHub (Mar 2, 2021):

thanks @tg44 !!! it worked for me too!

<!-- gh-comment-id:788565760 --> @MrCaringi commented on GitHub (Mar 2, 2021): thanks @tg44 !!! it worked for me too!
Author
Owner

@timdonovanuk commented on GitHub (Mar 2, 2021):

Any idea how to migrate from an existing mysql nginx-proxy-manager install?

<!-- gh-comment-id:788786320 --> @timdonovanuk commented on GitHub (Mar 2, 2021): Any idea how to migrate from an existing mysql nginx-proxy-manager install?
Author
Owner

@tg44 commented on GitHub (Mar 2, 2021):

@timdonovanuk mysql2sqlite should work well.

<!-- gh-comment-id:788836950 --> @tg44 commented on GitHub (Mar 2, 2021): @timdonovanuk [mysql2sqlite](https://github.com/dumblob/mysql2sqlite) should work well.
Author
Owner

@timdonovanuk commented on GitHub (Mar 2, 2021):

@tg44 awesome, thanks!

<!-- gh-comment-id:788860069 --> @timdonovanuk commented on GitHub (Mar 2, 2021): @tg44 awesome, thanks!
Author
Owner

@ionescu77 commented on GitHub (May 10, 2021):

Thank you all!

  • been running on sqlite, with no problems (docker-compose)
  • upgrade from 3.8.0 to v2.9.2 worked with no problems
  • compose file is the standard one from docs, with DB commented-out:
    https://nginxproxymanager.com/setup/
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'
    environment:
      # These are the settings to access your db
      #DB_MYSQL_HOST: "db"
      #DB_MYSQL_PORT: 3306
      #DB_MYSQL_USER: "npm"
      #DB_MYSQL_PASSWORD: "npm"
      #DB_MYSQL_NAME: "npm"
      # If you would rather use Sqlite uncomment this
      # and remove all DB_MYSQL_* lines above
      DB_SQLITE_FILE: "/data/database.sqlite"
      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
#    depends_on:
#      - db
#  db:
#    image: jc21/mariadb-aria:10.4
#    restart: always
#    environment:
#      MYSQL_ROOT_PASSWORD: 'npm'
#      MYSQL_DATABASE: 'npm'
#      MYSQL_USER: 'npm'
#      MYSQL_PASSWORD: 'npm'
#    volumes:
#      - ./data/mysql:/var/lib/mysql

So I guess no need for mysql anymore.

<!-- gh-comment-id:836565528 --> @ionescu77 commented on GitHub (May 10, 2021): Thank you all! - been running on sqlite, with no problems (docker-compose) - upgrade from `3.8.0` to `v2.9.2` worked with no problems - compose file is the standard one from docs, with DB commented-out: https://nginxproxymanager.com/setup/ ```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' environment: # These are the settings to access your db #DB_MYSQL_HOST: "db" #DB_MYSQL_PORT: 3306 #DB_MYSQL_USER: "npm" #DB_MYSQL_PASSWORD: "npm" #DB_MYSQL_NAME: "npm" # If you would rather use Sqlite uncomment this # and remove all DB_MYSQL_* lines above DB_SQLITE_FILE: "/data/database.sqlite" # Uncomment this if IPv6 is not enabled on your host # DISABLE_IPV6: 'true' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt # depends_on: # - db # db: # image: jc21/mariadb-aria:10.4 # restart: always # environment: # MYSQL_ROOT_PASSWORD: 'npm' # MYSQL_DATABASE: 'npm' # MYSQL_USER: 'npm' # MYSQL_PASSWORD: 'npm' # volumes: # - ./data/mysql:/var/lib/mysql ``` So I guess no need for mysql anymore.
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#177
No description provided.