Self-host NetBox with Docker
Source-of-truth IPAM and DCIM for tracking IP space, racks, devices, and cabling.
This page describes the Levelrail template for NetBox (Infrastructure). It deploys the services below as one Docker Compose app on your own server.
Project site: https://github.com/netbox-community/netbox-docker.Recommended memory: about 1024 MiB.
Services, ports and volumes
| Service | Image | Container ports | Volumes |
|---|---|---|---|
db | postgres:17-alpine | none | netbox_db_data -> /var/lib/postgresql/data |
netbox | netboxcommunity/netbox:v4.6-5.0.2 | 8080 | netbox_media -> /opt/netbox/netbox/medianetbox_reports -> /opt/netbox/netbox/reportsnetbox_scripts -> /opt/netbox/netbox/scripts |
redis | redis:7-alpine | none | netbox_redis_data -> /data |
Environment variables
| Service | Variable | Value |
|---|---|---|
db | POSTGRES_DB | Preset in the template |
db | POSTGRES_PASSWORD | Generated at deploy |
db | POSTGRES_USER | Preset in the template |
netbox | ALLOWED_HOSTS | Preset in the template |
netbox | DB_HOST | Preset in the template |
netbox | DB_NAME | Preset in the template |
netbox | DB_PASSWORD | Generated at deploy |
netbox | DB_USER | Preset in the template |
netbox | REDIS_CACHE_DATABASE | Preset in the template |
netbox | REDIS_CACHE_HOST | Preset in the template |
netbox | REDIS_CACHE_PORT | Preset in the template |
netbox | REDIS_DATABASE | Preset in the template |
netbox | REDIS_HOST | Preset in the template |
netbox | REDIS_PORT | Preset in the template |
netbox | SECRET_KEY | Generated at deploy |
netbox | SUPERUSER_EMAIL | Preset in the template |
netbox | SUPERUSER_NAME | Preset in the template |
netbox | SUPERUSER_PASSWORD | Generated at deploy |
Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.
Deploy NetBox with Levelrail
In the dashboard, open Apps, choose New app, then Browse templates, and select NetBox. Review the Compose body and deploy.
With the CLI:
levelrail-cli templates deploy netbox --name my-netboxSee Service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.
More Infrastructure templates
All templates are listed in the self-host gallery.