9028c2b903f2fdd2a1998231edec73111e0e6afd
Netbox Deployment
GitOps deployment for Netbox with Tailscale HTTPS access.
Prerequisites
PostgreSQL Database
Connect to your PostgreSQL server and create the database:
CREATE DATABASE netbox;
CREATE USER netbox WITH PASSWORD 'your-secure-password';
GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;
ALTER DATABASE netbox OWNER TO netbox;
Host Configuration
Download configuration files to /opt/netbox (first time only):
sudo mkdir -p /opt/netbox/{tailscale,app}
sudo curl -o /opt/netbox/tailscale/serve-config.json https://gitea.arnodo.fr/Damien/netbox-deployment/raw/branch/main/serve-config.json
sudo curl -o /opt/netbox/app/extra.py https://gitea.arnodo.fr/Damien/netbox-deployment/raw/branch/main/extra.py
sudo curl -o /opt/netbox/app/plugins.py https://gitea.arnodo.fr/Damien/netbox-deployment/raw/branch/main/plugins.py
Generate Secret Key
python3 -c "import secrets; print(secrets.token_urlsafe(50))"
Deployment
- Create a new stack in Portainer
- Select "Repository" and point to this repository
- Portainer will load
stack.envautomatically - Override sensitive values (
CHANGE_ME) in the environment variables section:TS_AUTHKEY- Tailscale auth key (reusable recommended)DB_PASSWORD- PostgreSQL passwordSECRET_KEY- Django secret keySUPERUSER_PASSWORD- Initial admin password
- Deploy
After First Deployment
Set SKIP_SUPERUSER=true to prevent superuser recreation on redeploy.
Access
Once deployed: https://netbox.taila5ad8.ts.net
Directory Structure
/opt/netbox/
├── tailscale/
│ └── serve-config.json # Tailscale HTTPS configuration
└── app/
├── extra.py # Wraps DATABASES with DynamicSchemaDict
└── plugins.py # Plugins activation and settings
Description
Languages
Python
100%