Hands-on tutorial

Tutorials · DevOps & Containers

How to Use NetBox as the Source of Truth for IP Addresses, Racks and Devices

Run NetBox in containers, import sites, racks, devices and prefixes, and use it as the single place where the network is documented, and as input for automation.

Intermediate11 min7 steps

Before you start

  • A Linux server with Docker and Docker Compose
  • An export of your current IP plan and device list
  • Basic familiarity with containers

Step by step

  1. Deploy NetBox

    Use the community Docker setup, which runs NetBox with PostgreSQL and Redis.

    git clone -b release https://github.com/netbox-community/netbox-docker.git
    cd netbox-docker
    docker compose pull && docker compose up -d
    
  2. Create the admin user and secure access

    Create a superuser, put NetBox behind HTTPS, and connect it to your directory or SSO for staff.

  3. Model sites and racks

    Add regions, sites, locations and racks, with rack elevations for each comms room.

  4. Add device types and devices

    Create manufacturers and device types with their interfaces, then add each device with its name, rack position, serial and management IP.

  5. Import IP prefixes and VLANs

    Import prefixes, VLANs and important addresses from your IP plan with CSV import. NetBox then shows utilisation per prefix.

  6. Record connections

    Add cables between interfaces, starting with uplinks and core links. LLDP data can help you check them.

  7. Use it for automation

    Scripts and tools such as Ansible can read devices, VLANs and addresses from the NetBox API, so configurations come from one source.

Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.

Pro tips

  • Back up the NetBox database daily.
  • Start with the data you use most; perfect completeness can come later.
  • Make updating NetBox part of every change.