Netbox is an IP address management and data center infrastructure management tool for modeling and documenting modern networks. It is designed for network and infrastructure to empower engineers with network automation. It helps you to make your work easier by creating a map of every device in the data center. It is free and open-source so you don’t need to pay for this solution.

In this post, we will show you how to install Netbox on Arch Linux.

Step 1 – Configure Repository

By default, the default repository is outdated in Arch Linux, so you will need to modify the default mirror list. You can do it by editing the mirror list configuration file:

nano  /etc/pacman.d/mirrorlist

Remove all lines and add the following lines:

## Score: 0.7, United States
Server =$repo/os/$arch
## Score: 0.8, United States
Server =$repo/os/$arch
Server =$repo/os/$arch
## Score: 0.9, United Kingdom
Server =$repo/os/$arch
## Score: 1.5, United Kingdom
Server =$repo/os/$arch
Server =$repo/os/$arch
## Score: 6.6, United States
Server =$repo/os/$arch
## Score: 6.7, United States
Server =$repo/os/$arch
## Score: 6.8, United States
Server =$repo/os/$arch
## Score: 7.1, India
Server =$repo/os/$arch
## Score: 10.1, United States
Server =$repo/os/$arch

Save and close the file, then update all the package indexes with the following command:

pacman -Syu

Step 2 – Install Require Dependencies

First, you will need to install Redis and other Python dependencies on your server. You can install all of them by running the following command.

pacman -S redis python python-pip git

After the successful installation, start and enable the Redis service with the following command.

systemctl start redis
systemctl enable redis

Step 3 – Install and Configure PostgreSQL

Netbox uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.

First, install PostgreSQL using the following command.

pacman -S postgresql

Next, initialize PostgreSQL with the following command.

sudo -u postgres initdb --locale en_US.UTF-8 -D /var/lib/postgres/data

Next, start and enable the PostgreSQL service.

systemctl start postgresql
systemctl enable postgresql

Next, log in to PostgreSQL with the following command.

sudo -u postgres psql

Next, create a database and user for Netbox using the following command.

CREATE USER netbox WITH PASSWORD 'password';

Finally, exit from the PostgreSQL shell with the following command.


Step 4 – Install and Configure Netbox

First, create a dedicated netbox user with the following command.

useradd -U netbox

Next, create a netbox directory and download the latest version of netbox inside the /opt/netbox.

mkdir /opt/netbox
cd /opt/netbox
git clone -b master .

Next, change the ownership of the netbox directory.

chown -R root:netbox /opt/netbox/

Next, navigate to the netbox directory and copy the sample configuration file.

cd /opt/netbox/netbox/netbox

Next, generate the secret key.




Next, edit the Netbox configuration file.

nano /opt/netbox/netbox/netbox/

Define your allowed hosts, database, and secret key as shown below:


# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
    'NAME': 'netbox',         # Database name
    'USER': 'netbox',               # PostgreSQL username
    'PASSWORD': 'password',           # PostgreSQL password
    'HOST': 'localhost',      # Database server
    'PORT': '',               # Database port (leave blank for default)
    'CONN_MAX_AGE': 300,      # Max database connection age

SECRET_KEY = 'e1y$sW(RBxLfT0Qn9592j_5^^ESOXDavM+n0iT+wP!4Y6XEYn%'

Save and close the file.

Then, navigate to the /opt/netbox directory and run the script to install all required dependencies.

cd /opt/netbox/

If everything is fine, you should see the following output.

 netbox.service ExecStart:

netbox-rq.service ExecStart:

After modifying these files, reload the systemctl daemon:
  > systemctl daemon-reload
Upgrade complete! Don't forget to restart the NetBox services:
  > sudo systemctl restart netbox netbox-rq

Next, activate the Netbox virtual environment with the following command.

source /opt/netbox/venv/bin/activate

Next, navigate to the netbox directory:

cd /opt/netbox/netbox

Next, create a super user for Netbox:

python3 createsuperuser

Define your admin user and password as shown below:

Username (leave blank to use 'root'): admin
Email address: [email protected]
Password (again): 
Superuser created successfully.

Step 5 – Create a Systemd Service File for Netbox

First, copy the gunicorn and another service file to the desired location.

cp /opt/netbox/contrib/ /opt/netbox/
cp -v /opt/netbox/contrib/*.service /etc/systemd/system/

Next, deactivate from the Python virtual environment.


Next, reload the systemd daemon, start both netbox services, and enable them to start at system reboot.

systemctl daemon-reload
systemctl start netbox netbox-rq
systemctl enable netbox netbox-rq

Wait for some time to start the Netbox completely. Then, check the Netbox listening port with the following command.

ss -antpl | grep 8001

You should see the following output.

LISTEN 0      0*    users:(("gunicorn",pid=62051,fd=5),("gunicorn",pid=62050,fd=5),("gunicorn",pid=62049,fd=5),("gunicorn",pid=62048,fd=5),("gunicorn",pid=62047,fd=5),("gunicorn",pid=62045,fd=5))

Step 6 – Configure Nginx as a Reverse Proxy

At this point, Netbox is installed and listening on port 8001 on localhost. To access Netbox from the outside network, you will need to configure Nginx as a reverse proxy for Netbox.

First, install Nginx with the following command.

pacman -S nginx-mainline

After installing Nginx, start and enable the Nginx service using the following command.

systemctl start nginx
systemctl enable nginx

Next, create a directory to store Nginx virtual host files.

mkdir /etc/nginx/sites-enabled

Next, create an Nginx configuration file for Netbox.

nano /etc/nginx/sites-enabled/netbox.conf

Add the following configuration.

server {
    listen 80;


    client_max_body_size 25m;

    location /static/ {
        alias /opt/netbox/netbox/static/;

    location / {
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;

Save and close the file, then edit the Nginx main configuration file.

nano /etc/nginx/nginx.conf

Add the following lines after http{:

server_names_hash_bucket_size 64;
include sites-enabled/*;

Save the file when you are done. Then, verify the Nginx configuration.

nginx -t

You will see the following output.

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Next, restart the Nginx service to implement the changes.

systemctl restart nginx

Step 7 – Access Netbox Web Interface

Now, open your web browser and access the Netbox using the URL You should see the Netbox welcome screen.



Click on the Login button. You should see the Netbox login page.

Provide your admin username and password and click on the Sign in button. You should see the Netbox dashboard on the following screen.


In this post, we explained how to install Netbox on Arch Linux. We also showed you how to configure Nginx as a reverse proxy for Netbox. You can now use Netbox in your organization and start managing all devices from a web browser. You can implement Netbox on dedicated server hosting from Atlantic.Net!