Install Netbox on Synology NAS DSM 7.2
Updated: 01/30/2025
Note this is going to use portainer. You will need YOUR PUID and GUID (see this guide).
Yaml for Portainer Stack
services:
netbox-redis:
image: redis
container_name: NETBOX-REDIS
hostname: netbox-redis
healthcheck:
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
command:
- sh
- -c
- redis-server --appendonly yes --requirepass <redis-password> #CHANGE THIS
user: PUID:GUID #CHANGE THIS
volumes:
- /volume1/docker/netbox/redis:/data:rw
environment:
- REDIS_PASSWORD=<redis-password> #CHANGE THIS
restart: on-failure:5
netbox-db:
image: postgres:16
container_name: NETBOX-POSTGRES-DB
hostname: netbox-db
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "netbox", "-U", "netbox-user"]
timeout: 45s
interval: 10s
retries: 10
volumes:
- /volume1/docker/netbox/db:/var/lib/postgresql/data:rw
environment:
POSTGRES_DB: netbox
POSTGRES_USER: netbox-user
POSTGRES_PASSWORD: <postgrespassword> #CHANGE THIS
restart: on-failure:5
netbox:
image: ghcr.io/linuxserver/netbox:latest
container_name: NETBOX
hostname: netbox
environment:
- PUID=PUID #CHANGE THIS
- PGID=GUID #CHANGE THIS
- TZ=America/Denver #CHANGE THIS
- SUPERUSER_EMAIL=<youremailhere> #CHANGE THIS
- SUPERUSER_PASSWORD=<yourpasswordhere> #CHANGE THIS
- ALLOWED_HOST=netbox.foo.bar
- DB_HOST=netbox-db
- DB_PORT=5432
- DB_NAME=netbox
- DB_USER=netbox-user
- DB_PASSWORD=<postgrespassword> #CHANGE THIS
- REDIS_HOST=netbox-redis
- REDIS_PORT=6379
- REDIS_PASSWORD=<redis-password> #CHANGE THIS
- REDIS_DB_TASK=0
- REDIS_DB_CACHE=1
volumes:
- /volume1/docker/netbox/config:/config:rw
ports:
- 9458:8000
restart: on-failure:5
depends_on:
netbox-redis:
condition: service_healthy
netbox-db:
condition: service_started
Source -- Follow these instructions (and contribute to Marius) for doing the build bit in Portainer if this is new to you. NOTE: You may not need the superuser username/password because it didn't work for me. I had to do some searching for the information below. Change the passwords indicated to something else. Make a note of them in your password manager!
Folder Structure
- create three folders under /docker
- config
- db
- redis
Start the stack
- While it's building add your netbox information to nginx proxy manager.
- Wait a few minutes (like 10) so everything is up and green. Connect to box to make sure it's up.
Next we actually need to setup the superuser and password
- SSH to the Synology.
- Get root
- cd to where docker-compose is
- Find your container ID
- Run the create superuser script
Now you should be able to log in.