/docker-netbox

Docker image for https://github.com/digitalocean/netbox

Primary LanguageShellMIT LicenseMIT

Netbox docker image

Docker image for NetBox.

Using docker-compose

  1. Create a copy of docker-compose.example.yml to docker-compose.prod.yml

  2. 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
    
  3. Create .env.app containing:

    SECRET_KEY=CHANGE_ME
    ALLOWED_HOSTS=['netbox.dev', 'localhost']
    
  4. 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 at
    • SECRET_KEY: required, should be randomly generated and 50 characters or more

    Optionally you can also change the database password by modifying POSTGRES_PASSWORD and DB_PASS.

  5. Create a new superuser using the following command:

    $ sudo docker-compose run --rm netbox createsuperuser
  6. Start the service stack:

    $ sudo docker-compose up -d

NetBox will be available under port 8000.