Skip to content
Christian Mäder edited this page Nov 20, 2019 · 17 revisions

Getting Started with Netbox Docker

This is a basic introduction on how to get started using Netbox with Docker on your local machine.

Requirements

It is required that you have a recent installation of Docker Community Edition (or compatible) and docker-compose. (The current minimal requirements are defined in our README.md).

You also need to have Git installed.

And finally you should be working on a Linux or macOS computer. Netbox Docker should technically also work on Docker for Windows (with Linux backend) or on the Windows Subsystem for Linux (WSL), but this guide does not cover this (yet).

Quick-Start

The first step is to clone the netbox-docker repository to your computer. For that, open a terminal (e.g. Terminal on macOS or xterm on Linux).

  1. First you should navigate to the directory where you would like to clone the project to, e.g. ~/projects/.
  2. Second have to clone the project.
  3. Then you should change to the new directory.
# (1)
mkdir -p ~/projects && cd projects

# (2)
git clone -b master https://github.com/netbox-community/netbox-docker.git

# (3)
cd netbox-docker

Now you need to create a new file which defines the port under which Netbox will be available. The file's name must be docker-compose.override.yml and it's content should be as follows:

version: '3.4'
services:
  nginx:
    ports:
    - 6000:8080

This file will define that Netbox Docker will always listen on port 6000 when it starts up. (Without that file it would listen on a random port so that you can start multiple Netbox instances in parallel.) If you already have something listening on port 6000 feel free to change it.

To get Netbox Docker up-and-running, here are the two final steps:

  1. You will need to pull all the containers from the Docker registry. This may take a while, depending on your internet connection.
  2. Finally you can start all the required Docker containers.
# (4)
docker-compose pull

# (5)
docker-compose up

You will see a lot of output on your screen. Netbox will be initialising the database and then start.

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

  • Username: admin
  • Password: admin
  • API Token: 0123456789abcdef0123456789abcdef01234567

Shutdown

If you want to just stop Netbox to continue work later on, use the following command.

# Stop all the containers
docker-compose stop

# Start the containers again
docker-compose up

If you want to stop Netbox and clean up any resources it allocated (database, files, etc.), use the following command. Attention: It will remove any data you have entered in Netbox!

docker-compose down -v
Clone this wiki locally