Run NetBox with Docker Compose and publish it through an external reverse proxy.
SECRET_KEY and explicit ALLOWED_HOSTS.netboxcommunity/netbox:latest (also available at ghcr.io/netbox-community/netbox)services:
netbox:
image: netboxcommunity/netbox:latest
restart: unless-stopped
depends_on:
- postgres
- redis
ports:
- "8000:8080"
environment:
- ALLOWED_HOSTS=netbox.example.com
- SECRET_KEY=your-secret-key-change-me
volumes:
- netbox-data:/etc/netbox
postgres:
image: postgres:16
restart: unless-stopped
environment:
- POSTGRES_DB=netbox
- POSTGRES_USER=netbox
- POSTGRES_PASSWORD=change-me
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:7
restart: unless-stopped
volumes:
- redis-data:/data
volumes:
netbox-data:
postgres-data:
redis-data:
<VirtualHost *:80>
ServerName netbox.example.com
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
</VirtualHost>
Use TLS and forward original host/protocol headers in production.
Deploying Netbox in containers for production? Our consulting covers:
Get expert help: office@linux-server-admin.com | Contact Page