README.md

netbox

Refer to the upstream documentation in case of doubts: https://netbox.readthedocs.io

1. Install and set up PostgreSQL

1.1. Install and initialize PostgreSQL

sudo dnf -y install postgresql-server
sudo -u postgres postgresql-setup --initdb

1.2. Configure authentication via password

Edit /var/lib/pgsql/data/pg_hba.conf and change auth method from ident to md5 for localhost

1.3. Start the server

sudo systemctl enable --now postgresql

1.4. Create a DB, user and grant priviledges

sudo -u postgres createuser netbox
sudo -u postgres createdb netbox
sudo -u postgres psql -c "
  alter user netbox with encrypted password 'kokot';
  grant all privileges on database netbox to netbox;
"

2. Install redis

It is possible to set up authentication, but this document is not touching it.

sudo dnf -y install redis
sudo systemctl enable --now redis

3. Install and set up web server

Configure SELinux:

sudo setsebool -P httpd_can_network_connect 1

Nginx

3.1. Install Nginx

sudo dnf -y install nginx

3.2. Create /etc/nginx/conf.d/netbox.conf with following content:

server {
    listen 80;
    listen [::]:80;
    server_name localhost;

    client_max_body_size 25m;

    location /static/ {
        alias /var/lib/netbox/static/;
    }

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

3.3. Start the webserver

sudo systemctl enable --now nginx

Apache

TBD.

4. Netbox

4.1. Install Netbox

sudo dnf -y install netbox

4.2. Prepare configuration

Modify /etc/netbox/config/configuration.py. The most interesting variables to change are:

  • ALLOWED_HOSTS
  • DATABASE
  • SECRET_KEY

In case you want to use LDAP:

REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend'

and configure /etc/netbox/config/ldap/ldap_config.py accordingly.

(Optional) 4.3. Populate database

sudo -u netbox /usr/share/netbox/manage.py migrate

(Optional) 4.4. Create superuser

sudo -u netbox /usr/share/netbox/manage.py createsuperuser

4.5. Start netbox

sudo systemctl enable --now netbox netbox-rq