3.6 KiB
NetBox Configuration
Configuration File
NetBox's configuration file contains all the important parameters which control how NetBox functions: database settings, security controls, user preferences, and so on. While the default configuration suffices out of the box for most use cases, there are a few required parameters which must be defined during installation.
The configuration file is loaded from $INSTALL_ROOT/netbox/netbox/configuration.py by default. An example configuration is provided at configuration_example.py, which you may copy to use as your default config. Note that a configuration file must be defined; NetBox will not run without one.
!!! info "Customizing the Configuration Module"
A custom configuration module may be specified by setting the NETBOX_CONFIGURATION environment variable. This must be a dotted path to the desired Python module. For example, a file named my_config.py in the same directory as settings.py would be referenced as netbox.my_config.
To keep things simple, the NetBox documentation refers to the configuration file simply as `configuration.py`.
Some configuration parameters may alternatively be defined either in configuration.py or within the administrative section of the user interface. Settings which are "hard-coded" in the configuration file take precedence over those defined via the UI.
Dynamic Configuration Parameters
Some configuration parameters are primarily controlled via NetBox's admin interface (under Admin > Extras > Configuration Revisions). These are noted where applicable in the documentation. These settings may also be overridden in configuration.py to prevent them from being modified via the UI. A complete list of supported parameters is provided below:
ALLOWED_URL_SCHEMESBANNER_BOTTOMBANNER_LOGINBANNER_TOPCHANGELOG_RETENTIONCUSTOM_VALIDATORSDEFAULT_USER_PREFERENCESENFORCE_GLOBAL_UNIQUEGRAPHQL_ENABLEDJOBRESULT_RETENTIONMAINTENANCE_MODEMAPS_URLMAX_PAGE_SIZENAPALM_ARGSNAPALM_PASSWORDNAPALM_TIMEOUTNAPALM_USERNAMEPAGINATE_COUNTPOWERFEED_DEFAULT_AMPERAGEPOWERFEED_DEFAULT_MAX_UTILIZATIONPOWERFEED_DEFAULT_VOLTAGEPREFER_IPV4RACK_ELEVATION_DEFAULT_UNIT_HEIGHTRACK_ELEVATION_DEFAULT_UNIT_WIDTH
Modifying the Configuration
The configuration file may be modified at any time. However, the WSGI service (e.g. Gunicorn) must be restarted before these changes will take effect:
$ sudo systemctl restart netbox
Configuration parameters which are set via the admin UI (those listed under "dynamic settings") take effect immediately.