Deployment
Deployment
Version requirement
- For versions > 1.5.3, single-binary deployment requires PostgreSQL. SQLite is deprecated.
Docker single-container (built-in PostgreSQL)
The image includes PostgreSQL. Recommended for most users.
One-click start (minimal config, first launch opens Setup Wizard):
docker run -d --name nginxpulse \
-p 8088:8088 \
-e PUID=1000 \
-e PGID=1000 \
-v ./docker_local/logs:/share/logs:ro \
-v ./docker_local/nginxpulse_data:/app/var/nginxpulse_data \
-v ./docker_local/pgdata:/app/var/pgdata \
-v ./docker_local/configs:/app/configs \
-v /etc/localtime:/etc/localtime:ro \
magiccoders/nginxpulse:latestReplace
PUID/PGIDwith the correct UID/GID on your host. This is used to prevent permission mismatch issues that can block log reads. See Docker Deployment Permissions below for details.
Useful env vars (built-in PG):
POSTGRES_USER/POSTGRES_PASSWORD/POSTGRES_DBPOSTGRES_PORT(default 5432)POSTGRES_LISTEN(default 127.0.0.1)POSTGRES_CONNECT_HOST(default 127.0.0.1)DATA_DIR(default/app/var/nginxpulse_data)PGDATA(default/app/var/pgdata)
If you want to use an external PG, set DB_DSN and the built-in PG will be bypassed.
In this case the built-in PG will not start, POSTGRES_* is ignored, and you can drop the /app/var/pgdata mount.
Docker Compose
A docker-compose.yml is provided in the repo. Update:
- log mount paths
- Configure
PUID/PGIDto align with host UID/GID if you hit permission issues. - mount
nginxpulse_dataandconfigsfor persistence; mountpgdataonly when using built-in PG /etc/localtimemount for timezone- On SELinux hosts (RHEL/CentOS/Fedora), append
:zor:Zto the volume options.
One-click start (minimal config, first launch opens Setup Wizard):
docker compose -f docker-compose-simple.yml up -dDocker Deployment Permissions
The image runs as a non-root user (nginxpulse) by default. Whether the app can read logs or write data depends on host directory permissions. If you can cat files via docker exec, you are likely root; it does not mean the app user can access them.
Recommended approach: align container UID/GID with host directory ownership.
Step 1: Check host directory UID/GID
ls -n /path/to/logs /path/to/nginxpulse_data /path/to/pgdata
# or
stat -c '%u %g %n' /path/to/logs /path/to/nginxpulse_data /path/to/pgdataStep 2: Pass PUID/PGID when starting the container
docker run ... \
-e PUID=1000 \
-e PGID=1000 \
-v /path/to/logs:/var/log/nginx:ro \
-v /path/to/nginxpulse_data:/app/var/nginxpulse_data:rw \
-v /path/to/pgdata:/app/var/pgdata:rw \
...Step 3: Ensure directories are readable/writable for that UID/GID
chown -R 1000:1000 /path/to/nginxpulse_data /path/to/pgdata
chmod -R u+rx /path/to/logsIf you use an external database (DB_DSN), you can skip mounting pgdata.
SELinux note (RHEL/CentOS/Fedora):
- These systems enable SELinux by default. Docker volumes may be visible but still inaccessible due to labels.
- Add
:zor:Zto re-label the mount::Zfor exclusive use by this container.:zto share across multiple containers.
docker run ... \
-v /path/to/logs:/var/log/nginx:ro,Z \
-v /path/to/nginxpulse_data:/app/var/nginxpulse_data:rw,Z \
-v /path/to/pgdata:/app/var/pgdata:rw,Z \
...Not recommended: chmod -R 777. It is unsafe; only use it for temporary debugging.
Single binary (non-Docker)
You must install PostgreSQL yourself.
Suggested steps:
- Install PostgreSQL and create DB/user.
- Set
database.dsninconfigs/nginxpulse_config.json. - Build & run (e.g.
scripts/build_single.sh).
Example DSN:
"database": {
"driver": "postgres",
"dsn": "postgres://nginxpulse:nginxpulse@127.0.0.1:5432/nginxpulse?sslmode=disable",
"maxOpenConns": 10,
"maxIdleConns": 5,
"connMaxLifetime": "30m"
}Local development
Use scripts/dev_local.sh:
- It starts a local docker postgres container by default.
- Data is stored in docker volume
nginxpulse_pgdata. - To reset:
docker volume rm nginxpulse_pgdata.
Ports
- 8088: Web UI
- 8089: API
Custom frontend base path
If you want to serve the UI under a subpath (e.g. /nginxpulse/), set system.webBasePath. Only a single path segment is supported. After changing it, restart the service. The root path / will be disabled.
Docker image (built-in Nginx)
- Set
webBasePathin system config (orWEB_BASE_PATHenv var). - Restart the container. New paths:
- PC:
/<base>/ - Mobile:
/<base>/m/ - API:
/<base>/api/
- PC:
The image generates Nginx config and /app-config.js on startup. No frontend rebuild needed.
Single binary (embedded frontend)
- Set
system.webBasePathin the config file. - Restart. New paths:
- PC:
/<base>/ - Mobile:
/<base>/m/ - API:
/<base>/api/
- PC:
Design principles
/app-config.jsdeliverswindow.__NGINXPULSE_BASE_PATH__so the frontend resolves base path at runtime.- Server middleware enforces prefix isolation; only
/<base>/...is allowed and API is forced to/<base>/api/*. - Static assets and
/app-config.jsstay accessible so the app can boot.
Timezone
The project uses system timezone for parsing.
- Docker: mount
/etc/localtime:/etc/localtime:ro - Bare metal: set system timezone and restart
UI configuration
All configurations listed in this document can also be managed visually in System Settings.