Install Nautobot on Ubuntu Server
This post will cover how to install Nautobot, installing and configuring the Nautobot application on an Ubuntu Server.
You can install Nautobot onto a RHEL (Red Hat Enterprise Linux) or Ubuntu. This post will cover a basic installation, with all of Nautobot’s processes running on a single server.
Nautobot Docker
The easiest way to install Nautobot is to clone the Nautobot Docker Repository and bring up Nautobot using Docker.
This post will cover a full install, installing Redis, Postgres and configuring the application.
Nautobot Dependencies
- Python 3.8 or greater
- Redis
- PostgreSQL
- Ubuntu Server 24.04
- 4 x vCPU
- 100GB disk space
- 16GB RAM
I am using a virtual Ubuntu Server in my lab, but the process will work the same on bare metal.
1. Install Redis
sudo apt install -y redis-server
To validate the Redis server is running you can use the regis-cli ping command
redis-cli ping
You should get a PONG response
2. Install PostreSQL
sudo apt install -y postgresql
Once Postgres has installed we need to create a database
3. Create a Database
sudo -iu postgres psql
Next create the database (remember to use a semicolon at the end of the command
CREATE DATABASE nautobot;
You should get the following command back
CREATE DATABASE postgres=#
4. Create a username and password
CREATE USER nautobot WITH PASSWORD 'yoursecretpassword';
Ensure your password is in quotes
5. Grant permissions to access the database
GRANT ALL PRIVILEGES ON DATABASE nautobot TO nautobot;
You now need to connect to the database to grant schema permissions
\connect nautobot
6. Grant permissions to create schema
GRANT CREATE ON SCHEMA public TO nautobot;
To exit Postgres CLI type \q
Validate access as the granted user
psql --username nautobot --password --host localhost nautobot
You will be prompted for the password you created earlier and you should get back something like this
Password: psql (16.7 (Ubuntu 16.7-1.pgdg22.04+1)) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off) Type "help" for help. nautobot=>
7. Install the Nautobot Application
Now all the prerequisites have been completed we can now progress with the install of Nautobot
8. Create a Nautobot user
sudo useradd --system --shell /bin/bash --create-home --home-dir /opt/nautobot nautobot
Verify user is created correctly and home folder is /opt/nautobot
eval echo ~nautobot
You should get back
/opt/nautobot
You can also validate the permissions
ls -l /opt/ | grep nautobot
Your response should be
drwxr-x--- 2 nautobot nautobot 4096 Aug 25 14:41 nautobot
9. Create a Virtual Environment to run Python dependencies for Nautobot
sudo -u nautobot python3 -m venv /opt/nautobot
10. Update the Nautobot_Root environment variable so it will always be set
echo "export NAUTOBOT_ROOT=/opt/nautobot" | sudo tee -a ~nautobot/.bashrc
11. Change user to Nautobot and verify environment variable is set as expected
sudo -iu nautobot
echo $NAUTOBOT_ROOT
You should see
/opt/nautobot
12. Activate the virtual envrionment
source /opt/nautobot/bin/activate
Ensure your prompt has changed to show the venv is active
13. Now we are ready to Install Nautobot
Everything is now performed as the nautobot user – do not install Nautobot as root.
14. Check you are running the latest version of pip
pip3 install --upgrade pip wheel
15. Install Nautobot latest version
All releases are here : https://github.com/nautobot/nautobot/releases
For this installation I am going to use version 3.0.9
pip install nautobot==3.0.9
Once installed you can check the version with
nautobot-server --version
16. Configure Nautobot
Run the init command and decline sending any metrics, a file called nautobot_config.py will be created.
nautobot-server init
17. Uncomment parts of the config file
You now need to uncomment a few lines in the config file.
# This is a list of valid fully-qualified domain names (FQDNs) for the Nautobot server. Nautobot will not permit write
# access to the server via any other hostnames. The first FQDN in the list will be treated as the preferred name.
#
# Example: ALLOWED_HOSTS = ['nautobot.example.com', 'nautobot.internal.local']
#
ALLOWED_HOSTS = ["*"]
# The django-redis cache is used to establish concurrent locks using Redis.
#
CACHES = {
"default": {
"BACKEND": os.getenv(
"NAUTOBOT_CACHES_BACKEND",
"django_prometheus.cache.backends.redis.RedisCache" if METRICS_ENABLED else "django_redis.cache.RedisCache",
),
"LOCATION": parse_redis_connection(redis_database=1),
"TIMEOUT": 300,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PASSWORD": "",
},
}
}
# Number of seconds to cache ContentType lookups. Set to 0 to disable caching.
CONTENT_TYPE_CACHE_TIMEOUT = int(os.getenv("NAUTOBOT_CONTENT_TYPE_CACHE_TIMEOUT", "0"))
# Celery Beat heartbeat file path - will be touched by Beat each time it wakes up as a proof-of-health.
CELERY_BEAT_HEARTBEAT_FILE = os.getenv(
"NAUTOBOT_CELERY_BEAT_HEARTBEAT_FILE",
os.path.join(tempfile.gettempdir(), "nautobot_celery_beat_heartbeat"),
)
# Celery broker URL used to tell workers where queues are located
#
CELERY_BROKER_URL = os.getenv("NAUTOBOT_CELERY_BROKER_URL", parse_redis_connection(redis_database=0))
# Optional configuration dict for Celery to use custom SSL certificates to connect to Redis.
#
CELERY_BROKER_USE_SSL = None
# Database configuration. See the Django documentation for a complete list of available parameters:
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
#
DATABASES = {
"default": {
"NAME": os.getenv("NAUTOBOT_DB_NAME", "nautobot"), # Database name
"USER": os.getenv("NAUTOBOT_DB_USER", ""), # Database username
"PASSWORD": os.getenv("NAUTOBOT_DB_PASSWORD", ""), # Database password
"HOST": os.getenv("NAUTOBOT_DB_HOST", "localhost"), # Database server
"PORT": os.getenv("NAUTOBOT_DB_PORT", ""), # Database port (leave blank for default)
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", "300")), # Database timeout
"ENGINE": os.getenv(
"NAUTOBOT_DB_ENGINE",
"django_prometheus.db.backends.postgresql" if METRICS_ENABLED else "django.db.backends.postgresql",
), # Database driver ("mysql" or "postgresql")
}
}
# Ensure proper Unicode handling for MySQL
#
if DATABASES["default"]["ENGINE"].endswith("mysql"):
DATABASES["default"]["OPTIONS"] = {"charset": "utf8mb4"}
# This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.
# For optimal security, SECRET_KEY should be at least 50 characters in length and contain a mix of letters, numbers, and
# symbols. Nautobot will not run without this defined. For more information, see
# https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-SECRET_KEY
18. Export Variables to use
echo "export NAUTOBOT_DB_USER=nautobot" | tee -a ~nautobot/.bash
echo 'export NAUTOBOT_DB_PASSWORD=yoursecretpassword' | tee -a ~nautobot/.bashrc
Reload your terminal so the environment variables are available
Or just type source ~/.bashrc
18. Launch Nautobot
Before we launch Nautobot you need to do a database migration
nautobot-server migrate
This will take a few minutes but when complete we still have a few steps
19. Create a Nautobot Superuser
nautobot-server createsuperuser
You will be prompted for a username, email address and password
When completed it will say Superuser created successfully.
20. Collect Static File
This command copies any static files into /opt/nautobot/static
nautobot-server collectstatic
21. Start the server
nautobot-server runserver 0.0.0.0:8080 --insecure
You should now be able to access Nautobot at http://<yourserverip>:8080
NOTE: This will only be operational whilst the terminal is open – in the next post I will cover how to make your Nautobot Server productionised
Frequently asked questions
How to setup Nautobot
The basic steps to setup Nautobot are:
- Establish a Nautobot root directory for the application environment.
- Create a nautobot system account.
- Create a Python virtual environment (virtualenv)
- Install Nautobot and all required Python packages.
- Run the database schema migrations.
- Aggregate static resource files on disk.
What are the requirements for a Nautobot server?
By default Nautobot will utilise approximately 1 CPU and 1.5Gb RAM for production use it’s recommended to have at least 2 x CPU’s and 4Gb of RAM per node
What is the meaning of Nautobot?
Nautobot stands for Network Automation Robot and is a tool developed by Network to Code which was originally a fork of Netbox
What is the default username and password for Nautobot?
The nautobot-lab container comes with a user pre-defined. The username is demo and its corresponding password is nautobot. For a production install there is no default username and password you create it at installation time with the superuser command.

Leave a Reply