Okay, setting up a lab environment is a fantastic idea for testing updates, new features, or just experimenting without impacting production. My goal here is to create a robust, yet easily reproducible copy of the existing Dockerized solution.
Here's my plan for setting up the new Linux server as a lab environment:
Executive Summary
The objective is to provision a new Linux server, install Docker and Docker Compose, and then deploy the existing Nautobot, PostgreSQL, pgAdmin, Portainer, and Traefik stack. The setup will prioritize ease of deployment, flexibility for experimentation, and clear separation from the production environment, potentially with a snapshot of production data.
Phase 1: Linux Server Provisioning & Initial Setup
-
Server Acquisition:
- Type: Likely a Virtual Machine (VM) in a hypervisor (VMware, Proxmox, VirtualBox, KVM) or a cloud instance (AWS EC2, Azure VM, GCP Compute Engine) with adequate resources (e.g., 2-4 vCPUs, 4-8GB RAM, 50-100GB SSD for base OS + Docker images + data).
- Operating System: Ubuntu Server LTS (e.g., 22.04 LTS) or CentOS Stream/Rocky Linux/AlmaLinux (latest stable version). Ubuntu is often chosen for its Docker support and ease of use.
-
Initial OS Configuration:
- Updates:
sudo apt update && sudo apt upgrade -y (Ubuntu) or sudo dnf update -y (RHEL-based).
- User Management: Create a non-root
sudo user for daily operations.
sudo adduser <your_username>
sudo usermod -aG sudo <your_username>
- SSH Hardening:
- Disable password authentication for SSH (
PasswordAuthentication no in /etc/ssh/sshd_config).
- Use SSH key-based authentication.
- Consider changing default SSH port (22) for minimal security hardening.
- Reload SSH service:
sudo systemctl restart sshd.
- Firewall Configuration:
- Install and configure UFW (Ubuntu) or Firewalld (RHEL-based).
- Allow SSH:
sudo ufw allow OpenSSH
- Allow HTTP(S) for Traefik:
sudo ufw allow http, sudo ufw allow https
- Enable firewall:
sudo ufw enable
- Ensure NTP is configured for accurate time. .