Introduction

NetBox IRM (Infrastructure Resource Manager) is an open-source platform for managing and documenting network infrastructure. This tutorial will guide you through the process of installing NetBox IRM on Debian 12.

Prerequisites

Before you begin, ensure you have:

  1. A Debian 12 server or desktop system
  2. Root or sudo privileges

Step 1: Install Dependencies

Update the package index and install the required dependencies:

sudo apt update
sudo apt install -y python3 python3-pip python3-venv python3-dev libpq-dev libxml2-dev libxslt1-dev libffi-dev libssl-dev npm

Step 2: Install PostgreSQL

Install PostgreSQL database server:

sudo apt install -y postgresql postgresql-contrib

Step 3: Create Database and User

Log in to PostgreSQL as the administrative user:

sudo -u postgres psql

Create a database and user for NetBox:

CREATE DATABASE netbox;
CREATE USER netbox WITH PASSWORD 'your_password';
ALTER DATABASE netbox OWNER TO netbox;
\q

Step 4: Install NetBox

Create a Python virtual environment:

python3 -m venv netbox-env
source netbox-env/bin/activate

Install NetBox and its dependencies:

pip install wheel
pip install netbox

Step 5: Configure NetBox

Generate a new secret key:

python3 /path/to/netbox-env/lib/python3.x/site-packages/netbox/generate_secret_key.py

Copy the generated secret key to the NetBox configuration file:

sudo cp /path/to/netbox-env/lib/python3.x/site-packages/netbox/netbox/configuration.py /opt/netbox/netbox/configuration.py

Update the database settings in the configuration file to point to the PostgreSQL database you created earlier.

Step 6: Initialize Database and Collect Static Files

Initialize the database schema:

sudo netbox-server migrate

Collect static files:

sudo netbox-server collectstatic --no-input

Step 7: Run NetBox Server

Start the NetBox development server:

sudo netbox-server runserver 0.0.0.0:8000

Access NetBox in your web browser at http://your_server_ip:8000. Log in with the default username "admin" and password "admin".

Conclusion

Congratulations! You have successfully installed NetBox IRM on Debian 12. You can now start using NetBox to manage and document your network infrastructure.

Was this answer helpful? 0 Users Found This Useful (0 Votes)