← All articles
a computer screen with a keyboard and a box with a logo

Self-Hosting NetBox: Network Documentation and IPAM Done Right

Networking 2026-02-15 · 5 min read netbox ipam network-documentation infrastructure dcim
By Selfhosted Guides Editorial TeamSelf-hosting practitioners covering open source software, home lab infrastructure, and data sovereignty.

Every growing homelab or business network eventually reaches the point where you can't keep track of what's connected where. Spreadsheets of IP addresses get stale. That wiki page about the VLAN layout hasn't been updated in months. You're SSHing into switches to figure out what's plugged into port 24.

Photo by Growtika on Unsplash

NetBox is an open source infrastructure modeling tool built by DigitalOcean's network engineering team. It gives you a structured database for documenting IP addresses, racks, devices, cables, circuits, VLANs, and more — with a REST API that makes it programmable.

NetBox logo

What NetBox Is (and Isn't)

NetBox is a source of truth for your network infrastructure. It doesn't monitor your network, configure devices, or collect metrics. Instead, it provides a single, authoritative place to document what your network looks like and how it's organized.

Think of it as the database behind your network, not the dashboard on top of it.

NetBox is... NetBox is NOT...
Network documentation A monitoring tool (use Grafana/Zabbix)
IP address management (IPAM) A configuration manager (use Ansible)
Device inventory A traffic analyzer (use ntopng)
Cable/circuit tracking A network controller (use Unifi)
Rack layout visualization An alerting system (use Prometheus)

NetBox vs. Alternatives

Feature NetBox phpIPAM RackTables Nautobot
License Apache 2.0 GPL GPL Apache 2.0
IPAM Yes (excellent) Yes (primary focus) Yes (basic) Yes (excellent)
DCIM (rack/device) Yes No Yes Yes
Cable tracking Yes No Limited Yes
REST API Yes (full) Yes (limited) No Yes (full + GraphQL)
Custom fields Yes Yes Limited Yes
Webhooks Yes No No Yes
Plugin system Yes No No Yes
Active development Very active Moderate Slow Active
Complexity Moderate Low Low High

When to choose NetBox

When phpIPAM is enough

Self-Hosting: What You Need

Server requirements

Docker setup

The official NetBox Docker project provides a well-maintained compose setup:

version: "3.8"
services:
  netbox:
    image: netboxcommunity/netbox:latest
    depends_on:
      - postgres
      - redis
    environment:
      DB_HOST: postgres
      DB_NAME: netbox
      DB_USER: netbox
      DB_PASSWORD: your-db-password
      REDIS_HOST: redis
      SECRET_KEY: your-secret-key-at-least-50-chars
      SUPERUSER_NAME: admin
      SUPERUSER_EMAIL: [email protected]
      SUPERUSER_PASSWORD: your-admin-password
    volumes:
      - netbox-media:/opt/netbox/netbox/media
      - netbox-reports:/opt/netbox/netbox/reports
      - netbox-scripts:/opt/netbox/netbox/scripts
    ports:
      - "8000:8080"
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: netbox
      POSTGRES_USER: netbox
      POSTGRES_PASSWORD: your-db-password
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    restart: unless-stopped

volumes:
  netbox-media:
  postgres-data:
  netbox-reports:
  netbox-scripts:

After starting, access NetBox at http://your-server:8000 and log in with your superuser credentials.

Like what you're reading? Subscribe to Self-Hosted Weekly — free weekly guides in your inbox.

Core Concepts

NetBox organizes infrastructure data into several modules:

IPAM (IP Address Management)

The most commonly used feature. NetBox lets you define:

The IPAM module automatically calculates subnet utilization, flags conflicts, and shows you which addresses are available in any prefix.

DCIM (Data Center Infrastructure Management)

For documenting physical infrastructure:

In a homelab context, you might have one "site" (your house), one or two "racks" (or just a shelf), and a dozen devices. NetBox handles this just as well as it handles enterprise data centers.

Circuits

Track internet connections, cross-connects, and WAN links:

Tenancy

If you manage infrastructure for multiple tenants (or want to tag resources by project/purpose), NetBox supports multi-tenancy with tenant groups and tenant assignments on most object types.

The API

NetBox's API is its killer feature for automation. Every object in the system is accessible via REST:

# List all prefixes
curl -s -H "Authorization: Token your-api-token" \
  http://netbox:8000/api/ipam/prefixes/ | jq '.results[].prefix'

# Find the next available IP in a prefix
curl -s -X POST -H "Authorization: Token your-api-token" \
  http://netbox:8000/api/ipam/prefixes/5/available-ips/ \
  -d '{"description": "new-server"}' | jq '.address'

# Create a new device
curl -s -X POST -H "Authorization: Token your-api-token" \
  -H "Content-Type: application/json" \
  http://netbox:8000/api/dcim/devices/ \
  -d '{"name": "switch-01", "device_type": 1, "site": 1, "role": 1}'

Common integrations:

What NetBox Won't Do

Backups

NetBox data lives primarily in PostgreSQL:

# Database backup
docker exec netbox-postgres pg_dump -U netbox netbox > netbox-backup.sql

# Media files (uploaded images, attachments)
docker run --rm -v netbox_netbox-media:/data -v $(pwd):/backup \
  alpine tar czf /backup/netbox-media.tar.gz -C /data .

Automate this daily — NetBox is your source of truth, and losing it means reconstructing your network documentation from scratch.

Bottom Line

NetBox is overkill for a three-device home network. But if you have managed switches, multiple VLANs, a growing device count, and you've ever thought "I should document this properly," NetBox is the right tool.

Start with IPAM — document your subnets and IP assignments. Then add devices and interfaces. Once you have the basics in place, the API opens up automation possibilities that spreadsheets can never match.

The Apache 2.0 license means it's genuinely free with no enterprise paywalls on core features. DigitalOcean actively maintains it, the community is strong, and the plugin ecosystem is growing. For infrastructure documentation, it's the standard.

Get free weekly tips in your inbox. Subscribe to Self-Hosted Weekly