2020-03-11 02:54:10 -04:00
# Full Setup Instructions
2018-07-31 20:04:34 -04:00
2021-03-21 12:02:53 -04:00
## MySQL Database
2018-07-31 20:04:34 -04:00
2020-08-06 00:27:29 -04:00
If you opt for the MySQL configuration you will have to provide the database server yourself. You can also use MariaDB. Here are the minimum supported versions:
2019-05-10 01:26:12 -04:00
- MySQL v5.7.8+
- MariaDB v10.2.7+
It's easy to use another docker container for your database also and link it as part of the docker stack, so that's what the following examples
are going to use.
2018-07-31 20:04:34 -04:00
2020-03-11 02:54:10 -04:00
::: warning
When using a `mariadb` database, the NPM configuration file should still use the `mysql` engine!
:::
2021-03-21 12:02:53 -04:00
## Running the App
2019-05-10 01:26:12 -04:00
Via `docker-compose` :
2018-07-31 20:04:34 -04:00
```yml
version: "3"
services:
app:
2020-11-07 13:37:35 -05:00
image: 'jc21/nginx-proxy-manager:latest'
2018-07-31 20:04:34 -04:00
restart: always
2018-08-24 02:59:03 -04:00
ports:
2019-05-10 01:26:12 -04:00
# Public HTTP Port:
2020-03-11 02:54:10 -04:00
- '80:80'
2019-05-10 01:26:12 -04:00
# Public HTTPS Port:
2020-03-11 02:54:10 -04:00
- '443:443'
2019-05-10 01:26:12 -04:00
# Admin Web Port:
2020-03-11 02:54:10 -04:00
- '81:81'
2021-03-18 00:20:47 -04:00
# Add any other Stream port you want to expose
# - '21:21' # FTP
2020-04-06 20:43:19 -04:00
environment:
2020-11-07 07:24:01 -05:00
# 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"
2020-04-06 20:43:19 -04:00
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
2018-07-31 20:04:34 -04:00
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
2021-02-07 20:56:21 -05:00
image: 'jc21/mariadb-aria:latest'
2018-07-31 20:04:34 -04:00
restart: always
environment:
2020-04-06 20:43:19 -04:00
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
2018-07-31 20:04:34 -04:00
volumes:
- ./data/mysql:/var/lib/mysql
```
2020-11-07 07:24:01 -05:00
_Please note, that `DB_MYSQL_*` environment variables will take precedent over `DB_SQLITE_*` variables. So if you keep the MySQL variables, you will not be able to use Sqlite._
2019-05-10 01:26:12 -04:00
Then:
2018-07-31 20:04:34 -04:00
```bash
2019-05-10 01:26:12 -04:00
docker-compose up -d
2018-07-31 20:04:34 -04:00
```
2021-03-21 12:02:53 -04:00
## Running on Raspberry PI / ARM devices
2018-07-31 20:04:34 -04:00
2020-02-18 23:55:06 -05:00
The docker images support the following architectures:
- amd64
- arm64
- armv7
2018-07-31 20:04:34 -04:00
2020-02-18 23:55:06 -05:00
The docker images are a manifest of all the architecture docker builds supported, so this means
2019-05-10 01:26:12 -04:00
you don't have to worry about doing anything special and you can follow the common instructions above.
2019-02-18 06:14:26 -05:00
2020-05-20 07:14:00 -04:00
Check out the [dockerhub tags ](https://hub.docker.com/r/jc21/nginx-proxy-manager/tags )
2019-05-10 01:26:12 -04:00
for a list of supported architectures and if you want one that doesn't exist,
[create a feature request ](https://github.com/jc21/nginx-proxy-manager/issues/new?assignees=&labels=enhancement&template=feature_request.md&title= ).
Also, if you don't know how to already, follow [this guide to install docker and docker-compose ](https://manre-universe.net/how-to-run-docker-and-docker-compose-on-raspbian/ )
on Raspbian.
2018-08-20 18:33:51 -04:00
2021-03-21 12:02:53 -04:00
Via `docker-compose` :
```yml
version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: always
ports:
# Public HTTP Port:
2021-03-22 03:50:25 -04:00
- '80:80'
2021-03-21 12:02:53 -04:00
# Public HTTPS Port:
2021-03-22 03:50:25 -04:00
- '443:443'
2021-03-21 12:02:53 -04:00
# Admin Web Port:
2021-03-22 03:50:25 -04:00
- '81:81'
2021-03-21 12:02:53 -04:00
environment:
# These are the settings to access your db
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "changeuser"
DB_MYSQL_PASSWORD: "changepass"
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/nginx-proxy-manager:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: ghcr.io/linuxserver/mariadb
restart: unless-stopped
environment:
PUID: 1001
PGID: 1001
TZ: "Europe/London"
MYSQL_ROOT_PASSWORD: "changeme"
MYSQL_DATABASE: "npm"
MYSQL_USER: "changeuser"
MYSQL_PASSWORD: "changepass"
volumes:
- ./data/mariadb:/config
```
_Please note, that `DB_MYSQL_*` environment variables will take precedent over `DB_SQLITE_*` var>
Then:
```bash
docker-compose up -d
```
2018-08-20 18:33:51 -04:00
2021-03-21 12:02:53 -04:00
## Initial Run
2018-08-20 18:33:51 -04:00
After the app is running for the first time, the following will happen:
2020-03-11 02:54:10 -04:00
1. The database will initialize with table structures
2. GPG keys will be generated and saved in the configuration file
3. A default admin user will be created
2018-08-20 18:33:51 -04:00
This process can take a couple of minutes depending on your machine.
2021-03-21 12:02:53 -04:00
## Default Administrator User
2018-08-20 18:33:51 -04:00
```
Email: admin@example.com
Password: changeme
```
Immediately after logging in with this default user you will be asked to modify your details and change your password.
2020-11-07 07:24:01 -05:00
2021-03-21 12:02:53 -04:00
## Configuration File
2020-11-07 07:24:01 -05:00
::: warning
This section is meant for advanced users
:::
If you would like more control over the database settings you can define a custom config JSON file.
Here's an example for `sqlite` configuration as it is generated from the environment variables:
```json
{
"database": {
"engine": "knex-native",
"knex": {
"client": "sqlite3",
"connection": {
"filename": "/data/database.sqlite"
2021-05-25 08:18:01 -04:00
},
"useNullAsDefault": true
2020-11-07 07:24:01 -05:00
}
}
}
```
You can modify the `knex` object with your custom configuration, but note that not all knex clients might be installed in the image.
Once you've created your configuration file you can mount it to `/app/config/production.json` inside you container using:
```
[...]
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
[...]
volumes:
- ./config.json:/app/config/production.json
[...]
[...]
```
**Note:** After the first run of the application, the config file will be altered to include generated encryption keys unique to your installation.
These keys affect the login and session management of the application. If these keys change for any reason, all users will be logged out.