Packer build that produces a qcow2 disk image with Nautobot pre-installed on Ubuntu 24.04 (Noble). The image is ready to boot under QEMU/KVM with no further provisioning required.
| Component | Details |
|---|---|
| OS | Ubuntu 24.04 LTS (Noble), fully upgraded |
| Nautobot | Latest release, installed in a Python venv at /opt/nautobot |
| Database | PostgreSQL (local, nautobot DB + user) |
| Cache / broker | Redis |
| Web server | Nginx → uWSGI socket |
| Services | nautobot, nautobot-worker, nautobot-scheduler (systemd, enabled at boot) |
- Packer ≥ 1.9
- QEMU with KVM (
qemu-system-x86_64,qemu-kvm) - ~5 GB free disk space for the build VM and output image
On macOS, replace accelerator with hvf (see Variables below).
packer init .
packer validate .
packer build .The output image is written to output/nautobot.qcow2 by default.
Override any variable with -var 'name=value' or a .pkrvars.hcl file.
| Variable | Default | Description |
|---|---|---|
ubuntu_iso_url |
Ubuntu 24.04 cloud image | Source image URL |
ubuntu_iso_checksum |
file:…/SHA256SUMS |
Checksum (verified automatically) |
output_directory |
output |
Directory for the built image |
vm_name |
nautobot |
Output filename (without .qcow2) |
disk_size |
20480 (20 GB) |
Disk size in MB, sparse qcow2 |
memory |
4096 |
Build VM RAM in MB |
cpus |
2 |
Build VM CPU count |
accelerator |
kvm |
QEMU accelerator: kvm, hvf, or none |
Example — build with more RAM and a custom output path:
packer build -var 'memory=8192' -var 'output_directory=/var/lib/libvirt/images' .-
Change the superuser password. A default admin account is created during the build:
- Username:
admin - Password:
admin
Log in at
http://<ip>/and change it immediately, or reset it via the CLI:sudo -u nautobot /opt/nautobot/bin/nautobot-server changepassword admin
- Username:
-
Restrict
ALLOWED_HOSTS. The default config accepts any hostname (*). Edit/opt/nautobot/nautobot_config.pyor set theNAUTOBOT_ALLOWED_HOSTSenvironment variable. -
Rotate the secret key. A random key is baked in at build time. For production, override it:
export NAUTOBOT_SECRET_KEY="your-strong-secret"
-
Check services are running:
systemctl status nautobot nautobot-worker nautobot-scheduler
Key environment variables read by nautobot_config.py:
| Variable | Default | Purpose |
|---|---|---|
NAUTOBOT_SECRET_KEY |
baked-in random value | Django secret key |
NAUTOBOT_ALLOWED_HOSTS |
* |
Comma-separated hostnames |
NAUTOBOT_DB_HOST |
localhost |
PostgreSQL host |
NAUTOBOT_DB_PASSWORD |
nautobot |
PostgreSQL password |
NAUTOBOT_REDIS_URL |
redis://localhost:6379/1 |
Redis cache URL |
NAUTOBOT_CELERY_BROKER_URL |
redis://localhost:6379/0 |
Celery broker URL |
NAUTOBOT_DEBUG |
false |
Enable Django debug mode |
See LICENSE.