Tutorial: How to Install Netbox on Windows 11

Netbox is an open-source web application for IP address and data center infrastructure management. It provides a centralized platform to manage all your network devices, IP addresses, and other assets. In this tutorial, we will guide you on how to install the Netbox application on a Windows 11 operating system.

Prerequisites

Before we start the installation process, you need to ensure that the following prerequisites are met:

Steps

Follow the steps given below to install the Netbox application:

Step 1: Install Required Dependencies

First, you need to install some dependencies required to run Netbox. You can use pip, the package installer for Python, to install the dependencies.

Open the command prompt or PowerShell as an administrator and run the following command:

pip install django psycopg2-binary django-rq netaddr cryptography napalm napalm-base napalm-junos napalm-iosxr napalm-nxos napalm-ios napalm-asa

Step 2: Clone Netbox Repository

Next, you need to clone the Netbox repository to your local machine. Open the command prompt or PowerShell and navigate to your preferred directory. Enter the following command to clone the repository from GitHub:

git clone -b release https://github.com/digitalocean/netbox.git

This will download Netbox to your local machine.

Step 3: Configure Netbox

After cloning the repository, navigate to the netbox/ directory and create a file named .env using the command below:

cd netbox
copy env.sample .env

Step 4: Generate Secret Key

Next, you need to generate a secret key for the Netbox application. Run the following command to create a new secret key:

python3 -c 'import secrets; print(secrets.token_hex(50))'

Copy the key and open the .env file in a text editor. Replace the SECRET_KEY value with your newly generated secret key.

Save and close the file.

Step 5: Create Database

Netbox requires a PostgreSQL database to store data. You can use the pre-built PostgreSQL Docker container for ease of setup.

To run PostgreSQL in a Docker container, run the following command:

docker run -d -e POSTGRES_USER=netbox -e POSTGRES_PASSWORD=netbox -e POSTGRES_DB=netbox --name netbox-psql -p 5432:5432 postgres:12-alpine

This will create a PostgreSQL container on your machine and make it accessible on port 5432.

Step 6: Configure Database Settings

Next, you need to configure the database settings in the .env file. Open the file in a text editor and update the following settings:

DATABASE_NAME=netbox
DATABASE_USER=netbox
DATABASE_PASSWORD=netbox
DATABASE_HOST=127.0.0.1
DATABASE_PORT=5432

Step 7: Run Database Migrations

After configuring the database settings, run the following command to run database migrations:

python manage.py migrate

This will create the necessary database tables.

Step 8: Create Superuser

You need to create a superuser account to log in to the Netbox application. Run the following command and follow the prompts to create a new superuser:

python manage.py createsuperuser

Step 9: Start Netbox

Finally, you can start the Netbox application using the following command:

python manage.py runserver

This will start the Netbox application on port 8000. Open your web browser and navigate to http://localhost:8000 to access the Netbox login page.

Log in with your superuser credentials to start using Netbox.

Conclusion

In this tutorial, we showed you how to install the Netbox application on a Windows 11 operating system. We covered all the necessary steps, including installing dependencies, cloning the Netbox repository, configuring the application, creating a PostgreSQL database, and starting the application. With this knowledge, you can now use Netbox to manage your network infrastructure seamlessly.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!