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.
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
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
Create the admin user and secure access
Create a superuser, put NetBox behind HTTPS, and connect it to your directory or SSO for staff.
Model sites and racks
Add regions, sites, locations and racks, with rack elevations for each comms room.
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.
Import IP prefixes and VLANs
Import prefixes, VLANs and important addresses from your IP plan with CSV import. NetBox then shows utilisation per prefix.
Record connections
Add cables between interfaces, starting with uplinks and core links. LLDP data can help you check them.
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.
FAQ
Frequently asked questions
Is NetBox free?
NetBox is open source; commercial hosted and supported versions are also available.
NetBox or spreadsheets?
Spreadsheets work for one small site. NetBox adds relationships, history, permissions and an API as the network grows.
Keep learning
Related guides
Document and label a network
Read more →Automate switch configuration with Ansible
Read more →Docker Compose for edge applications
Read more →How to Use SSH Keys Instead of Passwords for Network Devices and Servers
Passwords can be guessed, phished and reused. Create an SSH key pair, install the public key on gateways, edge servers and Linux hosts, then turn password logins off.
Read more →How to Reach Remote Sites Safely With an SSH Jump Host
Do not expose SSH on every device. Put one hardened jump host (bastion) in front of the management network and reach everything else through it.
Read more →How to Open a Device Web Page Through an SSH Tunnel
Reach the web interface of a switch, NVR or container on a remote site without opening a firewall port: forward it through SSH.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.