NetBox Using Docker Tutorial 2026: Installation Guide

After spending countless hours managing network infrastructure manually, I discovered NetBox could save me 10+ hours weekly on documentation tasks.
NetBox is an open-source IP address management (IPAM) and data center infrastructure management (DCIM) tool that transforms how you document and manage your network.
Running NetBox in Docker containers eliminates the traditional installation headaches – no more dependency conflicts or complex server configurations.
In this tutorial, I’ll walk you through the entire process of deploying NetBox using Docker, from initial setup to advanced configuration.
What is NetBox and Why Use Docker?
NetBox is a powerful network infrastructure resource modeling application designed to manage and document modern networks.
It provides comprehensive IP address management, rack elevation diagrams, device tracking, and circuit management in a single platform.
Docker containerization offers several advantages for NetBox deployment.
First, it provides consistent environments across different systems – what works on your laptop will work on your production server.
Second, Docker simplifies updates and rollbacks to just a few commands.
Third, all dependencies are packaged together, eliminating version conflicts that plague traditional installations.
⚠️ Important: NetBox requires PostgreSQL for its database and Redis for caching. Docker Compose handles both automatically.
Prerequisites and System Requirements (March 2026)
Before we start, ensure your system meets these requirements.
Hardware Requirements
- RAM: Minimum 4GB (8GB recommended for production)
- Storage: At least 10GB free disk space
- CPU: 2 cores minimum (4 cores for better performance)
Software Requirements
- Operating System: Linux (Ubuntu 22.04, Debian, CentOS) or Windows with WSL2
- Docker: Version 20.10 or higher
- Docker Compose: Version 2.0 or higher
- Git: For cloning the repository
Knowledge Prerequisites
You should be comfortable with basic command-line operations and understand fundamental networking concepts.
Docker experience helps but isn’t mandatory – I’ll explain each command.
Installing Docker and Docker Compose
Let’s start by installing Docker on your system.
Installing Docker on Ubuntu/Debian
First, update your package index and install prerequisites.
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add Docker’s official GPG key and repository.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Install Docker Engine.
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
Installing Docker Compose
Download the latest Docker Compose binary.
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Make it executable and verify the installation.
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Post-Installation Setup
Add your user to the docker group to run Docker without sudo.
sudo usermod -aG docker $USER
newgrp docker
Verify Docker is running correctly.
docker run hello-world
✅ Pro Tip: Enable Docker to start on boot with: sudo systemctl enable docker
Deploying NetBox with Docker Compose
Now we’ll deploy NetBox using the official Docker Compose configuration.
Clone the NetBox Docker Repository
Start by cloning the official NetBox Docker repository.
git clone https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
This repository contains all necessary configuration files and Docker Compose definitions.
Configure Environment Variables
Copy the example environment file and customize it.
cp env/netbox.env env/netbox.env.custom
nano env/netbox.env.custom
Key environment variables to configure:
| Variable | Description | Example Value |
|---|---|---|
| SECRET_KEY | Django secret key for security | Generate a random string |
| ALLOWED_HOSTS | Domains allowed to access NetBox | netbox.example.com |
| DB_PASSWORD | PostgreSQL password | Strong password |
| REDIS_PASSWORD | Redis cache password | Another strong password |
Generate a secure secret key using this command:
python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
Start NetBox Containers
Pull the Docker images and start all services.
docker-compose pull
docker-compose up -d
This command starts PostgreSQL, Redis, NetBox, and Nginx containers in the background.
Monitor the startup process with:
docker-compose logs -f netbox
Wait for the message “Netbox startup complete” before proceeding.
⏰ Time Saver: First startup takes 2-3 minutes as the database initializes. Subsequent starts are much faster.
Creating Admin User and First Login
With NetBox running, let’s create an admin account and access the web interface.
Create a Superuser Account
Execute this command to create your admin user:
docker-compose exec netbox python manage.py createsuperuser
Follow the prompts to set username, email, and password.
I recommend using a strong password with at least 12 characters.
Access the Web Interface
Open your browser and navigate to http://localhost:8080 (or your server’s IP).
Log in with the credentials you just created.
You’ll see the NetBox dashboard with sections for DCIM, IPAM, and other modules.
Initial Security Setup
Immediately after login, configure these security settings:
- Change default API token: Navigate to Admin → API Tokens
- Set session timeout: Configure in Admin → Configuration
- Enable HTTPS: Configure Nginx for SSL certificates
These steps protect your NetBox instance from unauthorized access.
Advanced Configuration Options in 2026
Let’s explore advanced features to maximize NetBox’s capabilities.
Installing Plugins
NetBox supports plugins for extended functionality.
Add plugins to your docker-compose.override.yml file:
version: '3.4'
services:
netbox:
environment:
PLUGINS: '["netbox_bgp", "netbox_dns"]'
PLUGINS_CONFIG: |
netbox_bgp:
top_level_menu: true
Popular plugins include netbox-bgp for BGP documentation and netbox-dns for DNS management.
Configuring LDAP Authentication
Enable LDAP for centralized authentication by adding these environment variables:
AUTH_LDAP_SERVER_URI: "ldap://ldap.example.com"
AUTH_LDAP_BIND_DN: "cn=admin,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD: "ldap_password"
Setting Up Automated Backups
Create a backup script for PostgreSQL data:
#!/bin/bash
docker-compose exec -T postgres pg_dump -U netbox netbox > backup_$(date +%Y%m%d).sql
Schedule it with cron for daily backups at 2 AM:
0 2 * * * /path/to/backup-script.sh
Performance Optimization
Improve NetBox performance with these tweaks:
- Increase worker processes: Set NETBOX_WORKERS=4 in environment
- Enable Redis persistence: Add appendonly yes to Redis config
- Allocate more memory: Adjust Docker memory limits in compose file
Common Issues and Troubleshooting
Here are solutions to frequent NetBox Docker problems I’ve encountered.
Container Won’t Start
Check container logs for specific errors:
docker-compose logs netbox
docker-compose logs postgres
Common causes include port conflicts (8080 already in use) or incorrect environment variables.
Database Connection Errors
If NetBox can’t connect to PostgreSQL, verify the database container is running:
docker-compose ps
docker-compose exec postgres psql -U netbox -c "SELECT 1"
Ensure DB_PASSWORD matches in both NetBox and PostgreSQL configurations.
Permission Denied Errors
Fix file permission issues with:
sudo chown -R 1000:1000 ./media ./static
docker-compose restart
Slow Performance Issues
If NetBox runs slowly, check resource usage:
docker stats
docker-compose exec netbox top
Consider increasing container memory limits or adding more workers.
Frequently Asked Questions
How much RAM does NetBox Docker require?
NetBox Docker requires a minimum of 4GB RAM for basic operation. For production environments with multiple users, I recommend 8GB or more for optimal performance.
Can I run NetBox Docker on Windows?
Yes, you can run NetBox Docker on Windows using WSL2 (Windows Subsystem for Linux 2) or Docker Desktop. WSL2 provides better performance than traditional Windows containers.
How do I update NetBox to the latest version?
Update NetBox by pulling the latest images with ‘docker-compose pull’, then restart with ‘docker-compose down’ followed by ‘docker-compose up -d’. Always backup your data first.
What’s the default NetBox Docker port?
NetBox Docker uses port 8080 by default for HTTP access. You can change this in the docker-compose.yml file by modifying the ports section under the nginx service.
How do I reset a forgotten admin password?
Reset the admin password by running ‘docker-compose exec netbox python manage.py changepassword admin’ and entering a new password when prompted.
Can I migrate from a standalone NetBox to Docker?
Yes, export your data using ‘python manage.py dumpdata’ from the standalone installation, then import it into the Docker version with ‘docker-compose exec netbox python manage.py loaddata’.
Next Steps and Additional Resources
You’ve successfully deployed NetBox using Docker and configured essential settings.
Your next steps should include importing your network infrastructure data and setting up regular backups.
Explore these resources to expand your NetBox knowledge:
- Official Documentation: docs.netbox.dev for comprehensive guides
- Community Slack: Join netbox-community.slack.com for support
- GitHub Repository: github.com/netbox-community for updates and issues
Remember to regularly update your NetBox instance for security patches and new features.
With proper configuration and maintenance, NetBox will transform your network documentation workflow.
