620a3b9c8c1fdf21c1b58e0a1d6e34a87dc3f989
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;
Tailscale Configuration
Download the serve configuration to /opt/ts-netbox (first time only):
sudo mkdir -p /opt/ts-netbox
sudo curl -o /opt/ts-netbox/serve-config.json https://gitea.arnodo.fr/Damien/netbox-deployment/raw/branch/main/serve-config.json
Generate Secret Key
python3 -c "import secrets; print(secrets.token_urlsafe(50))"
Portainer Environment Variables
| Variable | Description |
|---|---|
TS_AUTHKEY |
Tailscale auth key (reusable, ephemeral recommended) |
DB_PASSWORD |
PostgreSQL password for netbox user |
SECRET_KEY |
Django secret key (generate with command above) |
SUPERUSER_NAME |
Initial admin username |
SUPERUSER_EMAIL |
Initial admin email |
SUPERUSER_PASSWORD |
Initial admin password |
SKIP_SUPERUSER |
Set to true after first deployment |
Deployment
- Create a new stack in Portainer
- Point to this repository
- Configure environment variables
- Deploy
Access
Once deployed: https://netbox.taila5ad8.ts.net
Description
Languages
Python
100%