Install
In proxmox shell
How to install netbox (LXC)?
You could get the script ready to use from the community-scripts github folder right here: https://community-scripts.github.io/ProxmoxVE/scripts?id=netbox Then follow the instructions. You have to use the script in the proxmox node shell.
Apache2 or Nginx?
Choose nginx instead of apache2 as web server. So you need to replace it manually
apt remove apache2 -y
apt install nginx -y
Netbox plugins installation
Put in the configuration file (/opt/netbox/netbox/netbox/configuration.py) the plugins you want to add right in the netbox service and install them locally with pip.
Nginx sites configurations
Remember to change the name of the nginx server name to your DNS name. You should use only the port 80 and not the 443 and remove the certificates from the nginx configuration. You have to check both the sites-available and the sites-enabled to remove the requested cerficates. Caddy will provide for each needed certificates to make the site secured. (SSL certificates) The sites-enabled configurations should be something like this (you could use exacly the same configuration for the file inner the sites-available folder):
server {
listen [::]:80 ipv6only=off;
server_name netbox.eagleprojects.cloud;
client_max_body_size 25m;
location /static/ {
alias /opt/netbox/netbox/static/;
}
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Change the netbox configuration
You need to change the configuration of netbox to make allow the DNS as trusted origin. So dig /etc/netbox/netbox/netbox and edit the configuration.py file. Add another environment variable:
CSRF_TRUSTED_ORIGINS = [
'https://netbox.eagleprojects.cloud',
]
Now you could restart the netbox services with systemctl restart netbox netbox-rq and the service will be ready to use!