Nginx Proxy Guard

Getting started

Updating and backups

By the end of this page you can update NPG to the latest version, have settings backups made automatically, and restore them on another server.

Checking for a new version

On Settings → Global Settings, the Updates card at the top has Check for Updates, which compares your installed version with the latest release. NPG never updates itself. What changed in each version is in the changelog.

Updating

  1. Make a backup before updating. See "Making a backup" below.

  2. In the install directory, pull the new images and recreate the containers.

    cd ~/nginx-proxy-guard
    docker compose pull
    docker compose up -d
  3. Check with docker compose ps that every container is running.

The database schema is upgraded automatically when the API starts. There is no migration to run by hand.

Compare docker-compose.yml as well

Pulling new images leaves docker-compose.yml exactly as it was when you installed. New options that live in the compose file, such as port overrides, the sign-in request limit or container log size caps, only apply once the file is updated. Keep your current file, since you may have edited it, and compare.

cp docker-compose.yml docker-compose.yml.bak
wget -O docker-compose.yml https://raw.githubusercontent.com/svrforum/nginxproxyguard/main/docker-compose.yml
diff docker-compose.yml.bak docker-compose.yml

Carry over anything you had changed (port bindings, volume paths and so on) into the new file, then run docker compose up -d.

Pinning a version

The images in docker-compose.yml use the latest tag by default. To pin a version, set all three images to the same version number.

services:
  api:
    image: svrforum/nginxproxyguard-api:X.Y.Z
  ui:
    image: svrforum/nginxproxyguard-ui:X.Y.Z
  nginx:
    image: svrforum/nginxproxyguard-nginx:X.Y.Z

What a backup contains

A backup file (.tar.gz) made under Settings → Backups contains:

  • Proxy hosts with their security settings, redirect hosts, access lists
  • SSL certificates and DNS providers
  • WAF settings and rule exclusions, banned IPs, URI blocks, exploit block rules and their exceptions
  • Global settings and global security defaults, filter subscriptions, DDNS records, the Cloudflare Tunnel settings
  • Roles and SSO providers

Logs and user accounts are not in the backup file.

Making a backup

  1. Open Settings → Backups.
  2. Click Create Backup and choose what to include: Include Configuration Files, Include SSL Certificates, Include Database. Description (optional) takes a note.
  3. When it finishes, the file appears under Backup History. Use Download to keep a copy off the server.
Backup & Restore screen: create backup, auto backup settings, backup history
Backup & Restore screen: create backup, auto backup settings, backup history

Backup files are stored in the API container at /app/data/backups, which is the npg_api_data volume. If the server's disk fails they go with it, so downloading a copy is the safe choice.

Automatic backups

Turn on Enable Auto Backup under Auto Backup Settings. It is off by default.

  • Backup Schedule (Cron): default 0 2 * * * (daily at 2 AM). The format is minute hour day month weekday.
  • Backup Retention Count: default 10. Above that count the oldest backups are deleted first.

Restoring

  • For a backup on the same server, click Restore in Backup History.
  • For a file kept elsewhere, upload the .tar.gz file with Upload & Restore. The upload limit is about 100 MB.

Restoring overwrites the current settings with the backup's contents. When it finishes, NPG regenerates the nginx configuration and applies it.

Moving to another server

  1. Make a backup on the old server and download it.
  2. Install NPG on the new server by following Installation, including the initial setup.
  3. Upload the file on the new server under Settings → Backups → Upload & Restore.
  4. Point the domain's DNS and your router's port forwarding at the new server.

User accounts are not in the backup, so create them again on the new server. To move the logs as well, copy the Docker volumes (npg_postgres_data and the others) whole while the containers are stopped, instead of using a backup.

Common problems

  • A new option has no effect after the update. If it is set in the compose file, follow "Compare docker-compose.yml as well" above.
  • A container does not start after the update. Check docker compose logs api and docker compose logs nginx. The schema upgrade runs when the API starts, so the API log holds the reason.
  • The uploaded backup file is too large. The upload limit is about 100 MB. If the backup was made on the same server, restore it directly from Backup History.