This section describes how to get started with configuring Nautobot.
Initializing the Configuration¶
An initial configuration can be created by executing
nautobot-server init. This will generate a new configuration with all of the default settings provided for you, and will also generate a unique
By default (if you haven't set
NAUTOBOT_ROOT to some other value), the file will be created at
The Nautobot Installation Docs example sets
nautobot_config.py would be found at
You may specify a different location for the configuration as the argument to
Throughout the documentation, the configuration file will be referred to by name as
nautobot_config.py. If you use a custom file name, you must use that instead.
Specifying your Configuration¶
If you place your configuration in the default location at
$HOME/.nautobot/nautobot_config.py, you may utilize the
nautobot-server command and it will use that location automatically.
If you do not wish to utilize the default location, you have two options:
You may provide the
--config argument when executing
nautobot-server to tell Nautobot where to find your configuration. For example, to start a shell with the configuration in an alternate location:
You may also set the
NAUTOBOT_CONFIG environment variable to the location of your configuration file so that you don't have to keep providing the
--config argument. If set, this overrides the default location.
Nautobot Root Directory¶
By default, Nautobot will always read or store files in
~/.nautobot to allow for installation without requiring superuser (root) permissions.
NAUTOBOT_ROOT configuration setting specifies where these files will be stored on your file system. You may customize this location by setting the
NAUTOBOT_ROOT environment variable. For example:
This setting is also used in the Nautobot deployment guide to make the
nautobot-server command easier to find and use.
--config argument and the
NAUTOBOT_CONFIG environment variable will always take precedence over
NAUTOBOT_ROOT for the purpose of telling Nautobot where your
nautobot_config.py can be found.
Do not override
NAUTOBOT_ROOT in your
nautobot_config.py. It will not work as expected. If you need to customize this setting, please always set the
NAUTOBOT_ROOT environment variable.
Each of the features requiring use of file storage default to being stored in
NAUTOBOT_ROOT. If desired, you may customize each one individually. Please see each feature's respective documentation linked above for how to do that.
While Nautobot has many configuration settings, only a few of them must be defined at the time of installation. These configuration parameters may be set in
nautobot_config.py or by default many of them may also be set by environment variables. Please see the following links for more information:
Optional Authentication Configuration¶
Changing the Configuration¶
Configuration settings may be changed at any time. However, the WSGI service (e.g. uWSGI) must be restarted before the changes will take effect. For example, if you're running Nautobot using
Troubleshooting the Configuration¶
To facilitate troubleshooting and debugging of settings, try inspecting the settings from a shell.
First get a shell and load the Django settings:
SETTINGS_PATH variable. Does it match the configuration you're expecting to be loading?
If not, double check that you haven't set the
NAUTOBOT_CONFIG environment variable, or if you did, that the path defined there is the correct one.
Adding your own dependencies¶
Be cautious not to confuse extra applications with Nautobot plugins which are installed using the
PLUGINS setting. They are similar, but distinctly different!
Nautobot, being a Django application, allows for installation of additional dependencies utilizing the
INSTALLED_APPS settings. Due to the highly specialized nature of Nautobot, you cannot safely do this.
For example, let's assume that you want to install the popular
django-health-check plugin to your Nautobot deployment which requires you to add one or more
health_check entries to your
If you attempt to modify
INSTALLED_APPS yourself, you might see an error such as this:
Traceback (most recent call last): File "/usr/local/bin/nautobot-server", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.7/site-packages/nautobot/core/cli.py", line 53, in main initializer=_configure_settings, # Called after defaults File "/usr/local/lib/python3.7/site-packages/nautobot/core/runner/runner.py", line 193, in run_app management.execute_from_command_line([runner_name, command] + command_args) File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute django.setup() File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 95, in populate "duplicates: %s" % app_config.label) django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: health_check
To make it work, you would simply specify
For more information on installing extra applications, please see the documentation on Extra Applications.
For more information on installing or developing Nautobot plugins, please see the documentation on Plugins.