A straigntforward docker compose setup for Netbox that, unlike what Netbox officially provides, allows simple updating, simple configuration, no git clone needed, and local mounts instead of volumes. Also has an optional nginx setup to give Netbox its own IP on your network at port 80, as well as optional support for adding plugins via a simple Dockerfile.
- Use a password generator to add some passwords to the
.env
file - Optionally change the email in the
.env
file - Check the
docker-compose.yml
and:- Check the
netbox
service has the port you want, or remove it if you don't want that. - Check the
nginx
service to be sure it has the IP you want, or remove everything below the comment if you don't want that. Also ensure it has the correct bridge network name.
- Check the
- Run
docker compose up -d ; docker compose logs -f
to pull the images, start the services, and watch the logs. - Watch for any errors, and press
Ctrl
+C
when you're done with the log.
- In
docker-compose.yml
, comment out theimage
line for the netbox service, and uncomment thebuild
lines. - Follow any instructions the plugins have for setting them up.
pip install
commands should be added tonetbox.Dockerfile
- edits to
configuration.py
should be done innetbox/configuration.py
- Run
docker compose build --pull
to build the image. - Continue at step 4 of the Setup instructions.
- If using plugins, run
docker compose build --pull
- Run
docker compose pull
thendocker compose up -d
- (optional) clean up after with
docker image prune -af
If you see something in the logs about the Postgres version, try changing postgres:latest
to be something like postgres:14
This is released under the Unlicense license. See LICENSE
for details.