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 22 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.
| 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.
# Backend tests inside the test 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
cd frontend
npm run test./nukelabctl lint all # ruff + eslint/prettier + shellcheck/shfmt
./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.
The backend applies migrations on startup. To force a fresh migration:
./nukelabctl exec backend alembic upgrade head- 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