Refer to the upstream documentation in case of doubts: https://netbox.readthedocs.io
sudo dnf -y install postgresql-server
sudo -u postgres postgresql-setup --initdb
Edit /var/lib/pgsql/data/pg_hba.conf
and change auth method from ident
to md5
for localhost
sudo systemctl enable --now postgresql
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;
"
It is possible to set up authentication, but this document is not touching it.
sudo dnf -y install redis
sudo systemctl enable --now redis
Configure SELinux:
sudo setsebool -P httpd_can_network_connect 1
sudo dnf -y install nginx
/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;
}
}
sudo systemctl enable --now nginx
TBD.
sudo dnf -y install netbox
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.
sudo -u netbox /usr/share/netbox/manage.py migrate
sudo -u netbox /usr/share/netbox/manage.py createsuperuser
sudo systemctl enable --now netbox netbox-rq