Download the PHP package ancalagon/netbox-podman without Composer
On this page you can find all versions of the php package ancalagon/netbox-podman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ancalagon/netbox-podman
More information about ancalagon/netbox-podman
Files in ancalagon/netbox-podman
Package netbox-podman
Short Description Podman Quadlet deployment for NetBox — one-command bootstrap for integration testing
License MIT
Homepage https://github.com/bmairlot/netbox-podman
Informations about the package netbox-podman
NetBox Podman Quadlet
A rootless Podman deployment of NetBox using Quadlet (systemd-native container management). One command spins up a fully working NetBox instance with random credentials -- ideal for local development, integration testing, and CI pipelines.
This project is designed to work as a test fixture for the ancalagon/netbox PHP library, but is equally useful as a standalone NetBox deployment on any Linux system with Podman.
Prerequisites
- Podman (rootless mode) with Quadlet support (Podman 4.4+)
- systemd user session (
systemctl --usermust work) - openssl (for secret generation)
Quick Start
The first run will pull container images and run Django migrations, which may take a few minutes. Subsequent runs are faster -- especially with --keep-data, which preserves volumes so migrations are skipped entirely.
bootstrap.sh
| Option | Description |
|---|---|
--bind=ADDRESS |
Required. Reachable IP address to bind published ports to |
--json |
Output connection details as JSON to stdout (progress goes to stderr) |
--keep-data |
Preserve existing volumes (DB, Valkey, media) for faster startup |
-h, --help |
Show usage help |
The script will:
- Tear down any existing NetBox stack (calls
teardown.sh) - Generate random secrets (DB, Valkey, Django secret key, API token pepper, admin password)
- Resolve
{{PLACEHOLDER}}tokens in template files into agenerated/directory - Install Quadlet units to
~/.config/containers/systemd/ - Start the pod and wait for all health checks to pass
- Create an
adminsuperuser and print login credentials
teardown.sh
| Option | Description |
|---|---|
--keep-data |
Keep volumes intact (DB, Valkey, media) for faster re-bootstrap |
-h, --help |
Show usage help |
By default, stops all services and removes containers, pods, volumes, the Podman network, installed Quadlet units, and the generated/ directory. With --keep-data, volumes are preserved so the next ./bootstrap.sh skips migrations and starts much faster.
JSON Output
When using --json, the output contains everything a test harness needs:
Usage with Composer (PHP Integration Testing)
This repository can be added as a Composer dev dependency to provide a disposable NetBox instance for PHPUnit tests:
Composer will symlink bootstrap.sh and teardown.sh into vendor/bin/, so they are available on your $PATH when using Composer scripts.
Example: PHPUnit bootstrap file
Create a tests/bootstrap.php that starts NetBox before the test suite runs:
Then point your phpunit.xml at it:
Example: CI script
If you prefer to manage the lifecycle outside of PHP (e.g. in a Makefile or CI job):
For faster iteration during development, use --keep-data so that subsequent runs skip database migrations:
Architecture
All services run inside a single Podman pod on a dedicated bridge network (172.16.0.0/24).
Services
| Unit File | Image | Role |
|---|---|---|
netbox-netbox.container |
netboxcommunity/netbox:latest-4.0.0 |
Web app (port 8080 internal, 8000 published) |
netbox-worker.container |
netboxcommunity/netbox:latest-4.0.0 |
RQ background worker |
netbox-postgres.container |
postgres:17-alpine |
PostgreSQL database |
netbox-valkey.container |
valkey/valkey:8.1-alpine |
Task queue (port 6380) |
netbox-valkey-cache.container |
valkey/valkey:8.1-alpine |
Cache (port 6379) |
Startup Dependencies
Volumes
Persistent data uses named Podman volumes: netbox-postgres-data, netbox-media-files, netbox-report-files, netbox-script-files, netbox-valkey-data, netbox-valkey-cache-data.
Configuration
Template Files
Environment files in env/ and netbox-configuration/extra.py use {{PLACEHOLDER}} tokens that bootstrap.sh resolves with random values into the generated/ directory (git-ignored). Templates are never modified.
| File | Placeholders |
|---|---|
env/netbox.env |
{{DB_PASSWORD}}, {{REDIS_PASSWORD}}, {{REDIS_CACHE_PASSWORD}}, {{SECRET_KEY}} |
env/postgres.env |
{{DB_PASSWORD}} |
env/valkey.env |
{{REDIS_PASSWORD}} |
env/valkey-cache.env |
{{REDIS_CACHE_PASSWORD}} |
netbox-configuration/extra.py |
{{API_TOKEN_PEPPER}} |
netbox.pod |
{{BIND_ADDRESS}} |
Application Config
netbox-configuration/configuration.py-- Main Django settings, driven entirely by environment variables. Do not edit directly.netbox-configuration/extra.py-- Override settings that can't be expressed as env vars (e.g.API_TOKEN_PEPPERS,PLUGINS_CONFIG).
Security Considerations
By default, bootstrap.sh binds to 0.0.0.0, which exposes NetBox on all network interfaces. For local-only access, use:
For any deployment beyond local development, you should place a reverse proxy in front of NetBox to handle TLS termination. For example, with Caddy:
Or with Nginx:
When using a reverse proxy, always bind to 127.0.0.1 so NetBox is not directly reachable from the network.
Roadmap
Helm Chart for OpenShift / Kubernetes
The long-term goal of this project is to produce a Helm chart that deploys NetBox on OpenShift and Kubernetes clusters. The Podman Quadlet setup serves as the reference architecture for:
- Service dependency graph and startup ordering
- Health check definitions (mapped to
readinessProbe/livenessProbe) - Environment variable surface and secrets management (mapped to ConfigMaps / Secrets)
- Volume requirements (mapped to PersistentVolumeClaims)
- Network topology (mapped to Services and Routes/Ingress)
Planned Helm chart features:
- Separate Deployments for the web app and worker, StatefulSets for PostgreSQL and Valkey
- OpenShift Routes with TLS passthrough
- Configurable StorageClass for PVCs
- Horizontal Pod Autoscaler for the web app tier
- Optional external PostgreSQL / Valkey for production use
License
MIT