Docker image for NetBox.
-
Create a copy of
docker-compose.example.yml
todocker-compose.prod.yml
-
Create .env containing:
COMPOSE_FILE=docker-compose.prod.yml #TZ= #Set me to your timezone i.e. Europe/Stockholm DB_HOST=db DB_NAME=netbox DB_USER=netbox DB_PASS=netbox
-
Create .env.app containing:
SECRET_KEY=CHANGE_ME ALLOWED_HOSTS=['netbox.dev', 'localhost']
-
Change settings specifically for this instance:
ALLOWED_HOSTS
: accepts multiple hostnames separated using spaces, you should add the hostname which the installation will be reached atSECRET_KEY
: required, should be randomly generated and 50 characters or more
Optionally you can also change the database password by modifying
POSTGRES_PASSWORD
andDB_PASS
. -
Create a new superuser using the following command:
$ sudo docker-compose run --rm netbox createsuperuser
-
Start the service stack:
$ sudo docker-compose up -d
NetBox will be available under port 8000.