Skip to content
Christian Mäder edited this page Oct 9, 2019 · 11 revisions

You can configure the app using environment variables. These are defined in netbox.env. Read Environment Variables in Compose to understand about the various possibilities to overwrite these variables. (The easiest solution being simply adjusting that file.)

To find all possible variables, have a look at the [configuration.py][docker-config] and [docker-entrypoint.sh][entrypoint] files. Generally, the environment variables are called the same as their respective Netbox configuration variables. Variables which are arrays are usually composed by putting all the values into the same environment variables with the values separated by a whitespace (" "). For example defining ALLOWED_HOSTS=localhost ::1 127.0.0.1 would allows access to Netbox through http://localhost:8080, http://[::1]:8080 and http://127.0.0.1:8080.

Configure for Production

The default settings are optimized for (local) development environments. You should therefore adjust the configuration for production setups, at least the following variables:

  • ALLOWED_HOSTS: Add all URLs that lead to your Netbox instance, space separated. E.g. ALLOWED_HOSTS=netbox.mycorp.com server042.mycorp.com 2a02:123::42 10.0.0.42 localhost ::1 127.0.0.1 (It's good advice to always allow localhost connections for easy debugging, i.e. localhost ::1 127.0.0.1.)
  • DB_*: Use your own persistent database. Don't use the default passwords!
  • EMAIL_*: Use your own mailserver.
  • MAX_PAGE_SIZE: Use the recommended default of 1000.
  • SUPERUSER_*: Only define those variables during the initial setup, and drop them once the DB is set up. Don't use the default passwords!
  • REDIS_*: Use your own persistent redis. Don't use the default passwords!
Clone this wiki locally