ubuntu-nautobot/setup_nautobot.sh
2025-11-14 21:52:57 +00:00

26 lines
702 B
Bash

#!/bin/sh
# Setup basic programs
sh /setup_programs.sh
# Setup environment
apt install -y python3 python3.10-venv python3-pip
# Create user
useradd --system --shell /bin/bash --create-home --home-dir /opt/nautobot nautobot
chown nautobot /opt/nautobot
# Create the Virtual Environment
su -c "python3 -m venv /opt/nautobot/" nautobot
# Add NAUTOBOT_ROOT to the nautobot user .bashrc file
echo "export NAUTOBOT_ROOT=/opt/nautobot" | tee -a ~nautobot/.bashrc
# Update Python Pip and Wheel
su -c "pip3 install --upgrade pip wheel" nautobot
# Pip install Nautobot
su -c "pip3 install --no-binary=pyuwsgi nautobot" nautobot
# Verify
su -c "/opt/nautobot/.local/bin/nautobot-server --version" nautobot