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
.envfile - Optionally change the email in the
.envfile - Check the
docker-compose.ymland:- Check the
netboxservice has the port you want, or remove it if you don't want that. - Check the
nginxservice 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 -fto pull the images, start the services, and watch the logs. - Watch for any errors, and press
Ctrl+Cwhen you're done with the log.
- In
docker-compose.yml, comment out theimageline for the netbox service, and uncomment thebuildlines. - Follow any instructions the plugins have for setting them up.
pip installcommands should be added tonetbox.Dockerfile- edits to
configuration.pyshould be done innetbox/configuration.py
- Run
docker compose build --pullto build the image. - Continue at step 4 of the Setup instructions.
- If using plugins, run
docker compose build --pull - Run
docker compose pullthendocker 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.