Self-host NetBox with Levelrail

Source-of-truth IPAM and DCIM for tracking IP space, racks, devices, and cabling.

How to self-host NetBox

  1. Pull the images

    3 images are pulled on your server.

    Show images
    • postgres:17-alpine
    • netboxcommunity/netbox:v4.6-5.0.2
    • redis:7-alpine
  2. Create the app

    3 services start in a single Compose app, with 5 named volume mounts for your data, on port 8080.

  3. Fill in the secrets

    4 secrets are generated and stored encrypted, 14 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

NetBox requirements

Memory
About 1 GiB
Architectures
amd64 image published, arm64 image published
Ports
8080
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
Apache-2.0, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
  • Host ports. It publishes port 8080 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then NetBox. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the NetBox docs page.

Deploy NetBox your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy NetBox from the CLI

levelrail-cli templates deploy netbox --name my-netbox

Deploy NetBox with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/netbox/deploy

NetBox configuration

NetBox services

ServiceImagePortsVolumes
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

NetBox environment variables

VariableServiceValue
POSTGRES_DB db Preset by the template
POSTGRES_PASSWORD db Generated at deploy
POSTGRES_USER db Preset by the template
ALLOWED_HOSTS netbox Preset by the template
DB_HOST netbox Preset by the template
DB_NAME netbox Preset by the template
DB_PASSWORD netbox Generated at deploy
DB_USER netbox Preset by the template
Show all 18 variables
  • REDIS_CACHE_DATABASEnetboxPreset by the template
  • REDIS_CACHE_HOSTnetboxPreset by the template
  • REDIS_CACHE_PORTnetboxPreset by the template
  • REDIS_DATABASEnetboxPreset by the template
  • REDIS_HOSTnetboxPreset by the template
  • REDIS_PORTnetboxPreset by the template
  • SECRET_KEYnetboxGenerated at deploy
  • SUPERUSER_EMAILnetboxPreset by the template
  • SUPERUSER_NAMEnetboxPreset by the template
  • SUPERUSER_PASSWORDnetboxGenerated at deploy

Ports and volumes

Ports
8080
Volumes
5 named mounts: netbox_db_data -> /var/lib/postgresql/data, netbox_media -> /opt/netbox/netbox/media, netbox_reports -> /opt/netbox/netbox/reports, netbox_scripts -> /opt/netbox/netbox/scripts, netbox_redis_data -> /data

NetBox FAQ

How much memory does NetBox need?

The catalog lists about 1 GiB of memory for NetBox across its 3 services.

Does NetBox run on arm64?

For NetBox, an arm64 image is published; amd64 is image published.

What licence is NetBox under?

NetBox is licensed under Apache-2.0, which is permissive, with few conditions on reuse.

Does NetBox need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does NetBox bundle?

The template includes Postgres and Redis, running as its own service.

Which ports does NetBox use?

NetBox listens on port 8080 inside the stack.

Where does NetBox keep its data?

In named volumes: netbox_db_data mounted at /var/lib/postgresql/data, netbox_media mounted at /opt/netbox/netbox/media, netbox_reports mounted at /opt/netbox/netbox/reports and netbox_scripts mounted at /opt/netbox/netbox/scripts.

Can I deploy NetBox on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for NetBox, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image postgres:17-alpine, netboxcommunity/netbox:v4.6-5.0.2, redis:7-alpine is what you deploy there.

levelrail-cli templates deploy netbox --name my-netbox