NetBox is an open-source IP address management (IPAM) and data center infrastructure management (DCIM) tool designed to help manage and document your network. In this guide, we will walk you through the steps to install NetBox IRM (Infrastructure Resource Management) on Debian 11. Whether you are deploying it on a local server or using a Windows VPS UK, this tutorial covers all the necessary steps.
Step 1: Update Your System
Before installing NetBox, ensure your system is up to date. Run the following commands:
sudo apt update && sudo apt upgrade -y
Keeping your system updated is crucial for security and performance, whether you're setting it up locally or on a VPS Windows Servers platform.
Step 2: Install Required Dependencies
Install the necessary packages and dependencies:
sudo apt install python3 python3-pip python3-venv git postgresql postgresql-contrib libpq-dev -y
Step 3: Install and Configure PostgreSQL
Start the PostgreSQL service:
sudo systemctl start postgresql
Enable it to start on boot:
sudo systemctl enable postgresql
Create a database and user for NetBox:
sudo -u postgres psql
CREATE DATABASE netbox;
CREATE USER netbox_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox_user;
\q
Replace your_password
with a strong password of your choice.
Step 4: Download NetBox
Navigate to the /opt
directory and clone the NetBox repository:
cd /opt
sudo git clone -b master https://github.com/netbox-community/netbox.git
cd netbox
Step 5: Configure NetBox
Copy the example configuration file:
sudo cp netbox/netbox/configuration.example.py netbox/netbox/configuration.py
Edit the configuration file:
sudo nano netbox/netbox/configuration.py
Update the following settings:
DATABASE = {
'NAME': 'netbox',
'USER': 'netbox_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '',
}
Step 6: Install Python Requirements
Create a virtual environment and install the required Python packages:
sudo python3 -m venv netbox/venv
source netbox/venv/bin/activate
pip install -r requirements.txt
Step 7: Migrate the Database
Run the database migrations to set up the initial schema:
python3 manage.py migrate
Step 8: Create a Superuser
Create a superuser account for accessing the NetBox web interface:
python3 manage.py createsuperuser
Step 9: Start NetBox
You can run the development server using the following command:
python3 manage.py runserver 0.0.0.0:8000
Access NetBox by navigating to:
http://:8000