This guide covers how to run NukeLab locally for development and debugging.
- Docker or Podman
- docker-compose or podman-compose
- Git
- 10 GB free disk space
- Node.js 24 and npm (only if running the frontend outside containers)
git clone https://github.com/nukehub-dev/nukelab.git
cd nukelab
cp .env.example .env.developmentEdit .env.development if you need to change ports, credentials, or feature flags. The defaults are sufficient for most local work.
./nukelabctl devThis starts:
- Backend API, PostgreSQL, Redis, and Celery workers with auto-reload
- Frontend Vite dev server on http://localhost:5173
The dev stack uses the same container names as the production stack. start and dev start refuse to run if the other stack is already up.
./nukelabctl dev start # Start dev stack
./nukelabctl dev restart # Restart dev stack
./nukelabctl dev logs backend # Stream backend logs
./nukelabctl dev logs frontend # Stream frontend logs
./nukelabctl dev stop # Stop dev stackIf you prefer to run the frontend directly on the host for faster iteration:
cd frontend
npm install
npm run devSet FRONTEND_URL=http://localhost:5173 in .env.development so the backend knows where to redirect or link.
When DEV_MODE=true, the first startup creates:
- Username:
admin - Password:
admin123
Change these in .env.development or create additional users through the admin UI.
Fresh installs seed Small/Medium/Large plans as visible to the user role, but
environments are admin-created. Sign in as an administrator, open
Administration → Setup (/admin/setup), publish an active public
environment and confirm at least one plan is available to users before
deploying. Private volume recovery remains disabled until the operator
configures VOLUME_BACKUP_HOST_PATH, VOLUME_BACKUP_STORAGE_PATH and a trusted
helper image; see BACKUP-RESTORE.md.
| Service | Production stack | Development stack |
|---|---|---|
| Frontend | http://localhost:8080 | http://localhost:5173 |
| API | http://localhost:8080/api | http://localhost:8080/api |
| API docs | http://localhost:8080/api/docs | http://localhost:8080/api/docs |
Works out of the box. The backend auto-detects /var/run/docker.sock.
The project auto-detects Podman and configures the correct socket path (typically /run/user/1000/podman/podman.sock). No manual configuration is required.
For rootless Podman with cgroup-aware resource limits, you may need to delegate controllers:
sudo mkdir -p /etc/systemd/system/user@.service.d/
sudo tee /etc/systemd/system/user@.service.d/delegate.conf << 'EOF'
[Service]
Delegate=cpu cpuset io memory pids
EOF
sudo systemctl daemon-reloadLog out and back in for the change to take effect.
# Frontend unit tests plus backend tests in the one-off container
./nukelabctl test all
# Backend tests scoped to a file or directory
./nukelabctl test backend tests/api/servers/test_servers.py -x -v
# Frontend unit tests only
cd frontend
npm run test:unit
# Playwright browser tests (starts Vite by default)
npm run testSee CONTRIBUTING.md for the external disposable browser
stack used by CI and the E2E_EXTERNAL_SERVER=1 mode.
./nukelabctl lint all # ruff + eslint/prettier + shellcheck/shfmt + markdown
./nukelabctl lint all --fix # Auto-fix where supported
./nukelabctl selftest # nukelabctl sanity checkMake sure no other stack is running:
./nukelabctl status
./nukelabctl stop
./nukelabctl dev stopCheck that DOCKER_SOCKET in .env.development matches your active socket, or leave it empty for auto-detection.
Startup only creates missing tables when AUTO_CREATE_TABLES=true; it does not
upgrade existing columns. Apply Alembic migrations explicitly with the
pre-migration snapshot (the backend container must be running):
./nukelabctl db-migrateFor destructive or uncertain changes, take a backup first and review BACKUP-RESTORE.md.
- CONTRIBUTING.md for contribution workflow
- reference/ENV-VARS.md for environment variable reference
- reference/CLI-COMMANDS.md for
nukelabctlcommands - operations/PRODUCTION-DEPLOYMENT.md for production setup differences