How to deploy the Netbox network documentation/management tool with Docker

Deploying a network management/documentation tool is made simple with Docker.

How to deploy the Netbox network documentation/management tool with Docker

Netbox is a free open source tool that allows you to manage and document networks. It's incredibly powerful and seriously useful for any busy data center admin. With Netbox you can manage:

  • IP networks and addresses, VRFs, and VLANs
  • Equipment racks
  • Devices
  • Connections
  • Virtualization
  • Data circuits
  • Secrets

Problem is, trying to get Netbox installed manually can be a real challenge, even for seasoned admins. Fortunately, deploying Netbox as a Docker container makes things quite simple. 

I'm going to walk you through the process of deploying Netbox on Ubuntu Server 18.04, with the help of Docker.

SEE: Hiring kit: Database administrator (TechRepublic Premium)

What you'll need

The only things you'll need are a working instance of Ubuntu Server, although this should work on most Linux distributions, with minor modifications, and a user account with sudo privileges.

How to install Docker and docker-compose

The first thing to do is the installation of Docker. To do this, open a terminal window and issue the following commands:

  1. Install Docker with the command: sudo apt-get install -y.
  2. Add your user to the docker group with the command: sudo usermod -aG docker $USER.
  3. Log out and log back in to the server.
  4. Install docker-compose with the command: sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose.
  5. Change the permission of the docker-compose command with the command: sudo chmod +x /usr/local/bin/docker-compose.
  6. Start the docker daemon with the command sudo systemctl start docker.
  7. Enable the docker daemon with the command sudo systemctl enable docker.

How to deploy Netbox

Download the necessary files for deployment with the command:

git clone -b master

This will create a new directory called netbox-docker. Change into that directory with the command:

cd netbox-docker

Before you deploy the container, you'll want to edit the .env file and configure it to meet your needs. Issue the command:

nano env/netbox.env

In that file, you might want to change the line:


The above is the default password for the admin user. Change that to something unique and strong. Alter any other options you might want (such as SUPERUSER_EMAIL) and save the file. 

To deploy the container, issue the following commands:

docker-compose pull
docker-compose up -d

This will complete the deployment. 

How to access Netbox

It will take around two to five minutes before Netbox becomes available. During that time, issue the command:

echo "http://$(docker-compose port nginx 8080)/"

The above command will print out the exact port you should use to access Netbox (Figure A).

Figure A


The port to be used to access Netbox.

In the case of my example, the port to be used is 32768. So point a browser to http://SERVER_IP:32768 (where SERVER_IP is the IP address of the hosting server) and you should see the Netbox main page (Figure B). If the page doesn't appear, wait for a few more minutes for the service to become available and try again. 

Figure B


The Netbox main page.

Click Login and authenticate with the user admin and the password you added in the netbox.env file. 

And that's all there is to deploying Netbox the easy way. You are now ready to enjoy better network management/documentation.

Also see


Image: iStockphoto/Artystarty