Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Install Netbox on Docker

Rumi, June 19, 2020June 19, 2020

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

Install Docker with the command: 

sudo apt-get install docker.io -y

Add your user to the docker group with the command: 

sudo usermod -aG docker $USER.

Log out and log back in to the server. Install docker-compose with the command: 

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Change the permission of the docker-compose command with the command: 

sudo chmod +x /usr/local/bin/docker-compose

Start the docker daemon with the command 

sudo systemctl start docker

Enable the docker daemon with the command 

sudo systemctl enable docker

To get Netbox Docker up and running run the following commands. There is a more complete Getting Started guide on our wiki which explains every step.

Create Direcotry:

mkdir /var/netbox
cd /var/netbox
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
nginx:
ports:
- 8000:8080
EOF
docker-compose pull
docker-compose up (allow to run docker in the foregorund)
docker-compose up -d  (allow to run docker in the background)

The whole application will be available after a few minutes. Open the URL http://0.0.0.0:8000/ in a web-browser. You should see the Netbox homepage. In the top-right corner you can login. The default credentials are:

Username: admin
Password: admin
API Token: 0123456789abcdef0123456789abcdef01234567

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. In my case the following output is printed:

http://0.0.0.0:8000/

Tips:

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:

SUPERUSER_PASSWORD=admin

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. 

Src: 
https://www.techrepublic.com/article/how-to-deploy-the-netbox-network-documentationmanagement-tool-with-docker/
https://github.com/netbox-community/netbox-docker

Administrations Configurations (Linux) DockerNetBox

Post navigation

Previous post
Next post

Comments (2)

  1. Joerg says:
    July 30, 2021 at 1:50 am

    when i user in docker-compose.override.yml

    version: ‘3.4’
    services:
    nginx:
    ports:
    – 8000:8080

    i get this :
    supervisor@st-blf-12-mos3:/var/netbox/netbox-docker$ docker-compose pull
    ERROR: The Compose file is invalid because:
    Service nginx has neither an image nor a build context specified. At least one must be provided.

    Reply
    1. Rumi says:
      July 30, 2021 at 10:30 am

      Probably you may give a try by cleaning up the present docker and redeploy it again. Here’s what you may try-
      Stop the container(s) using the following command:
      docker-compose down
      Delete all containers using the following command:
      docker rm -f $(docker ps -a -q)
      Delete all volumes using the following command:
      docker volume rm $(docker volume ls -q)
      Restart the containers using the following command:
      docker-compose up -d

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes