Getting started
Introduction
Nginx Proxy Guard (NPG) manages an nginx reverse proxy from a web UI. It forwards requests for each domain to an internal service, issues and renews certificates, and applies security settings such as the WAF and access control per host or globally. It installs with Docker Compose and is built for the home-server case: one machine exposing several services to the internet.

How settings are applied
A value saved in the UI is written to the database, and NPG turns it into nginx configuration.
- The setting is stored in the database.
- NPG regenerates that host's nginx configuration file.
nginx -tchecks the whole configuration.- If the check passes, nginx reloads.
If the check fails, nginx is not reloaded and the previous configuration stays in place. The host then shows as Error in the Proxy Hosts list, and hovering over the status shows the message nginx reported. You never edit configuration files by hand: change the value in the UI and save again.
Components
docker compose up -d starts five containers.
| Container | Role |
|---|---|
npg-proxy | nginx, with the ModSecurity WAF and the OWASP CRS rules. It runs in host network mode, opens ports 80 and 443 directly and sees visitors' real addresses. The Cloudflare Tunnel connector (cloudflared) also runs in this container. |
npg-api | The API server. It renders settings into nginx configuration, collects logs, and runs certificate issuance, renewal and scheduled jobs. |
npg-ui | The admin UI, served over HTTPS on port 81 by default. |
npg-db | TimescaleDB (PostgreSQL). It stores settings and logs, and compresses older logs. |
npg-valkey | Cache. Optional: without it, the API caches in its own memory. |
What it does
- Proxy hosts: per-domain forwarding, load balancing across several backends, WebSockets, HTTP/3, custom nginx configuration, host cloning
- TCP/UDP streams and redirect hosts
- SSL certificates: Let's Encrypt (HTTP-01, DNS-01), uploaded certificates, self-signed certificates, automatic renewal
- WAF: ModSecurity with the OWASP CRS, detection and blocking modes, rule exclusions per host, path or argument
- Access control: access lists, geo and cloud blocking, bot filter, automatic bans, blocklist subscriptions, security headers and rate limits
- Global security defaults: set a security option once, then choose inherit, override or disable per host
- ForwardAuth: put an authentication server such as Authelia or Authentik in front of a host
- Dashboard and logs: per-request access logs, block reasons, WAF events, traffic statistics
- Users, roles and SSO: several admin accounts, role-based permissions, two-factor authentication, OpenID Connect sign-in, API tokens
- Notifications: Discord, Telegram, webhooks
- DDNS and Cloudflare Tunnel
- Settings and maintenance: global nginx settings, error pages, backup and restore
Requirements
- Docker 24.0 or later with Docker Compose v2
- linux/amd64 or linux/arm64 (ARM64 servers such as Raspberry Pi 4/5 included)
- Admin UI languages: Korean and English