Docker Deployment
Panguard provides Docker images and Compose configurations for containerized deployments. This guide covers single-container setup, full-stack Compose deployments, and production hardening.Prerequisites
| Requirement | Version |
|---|---|
| Docker | >= 24.0 |
| Docker Compose | >= 2.20 |
Quick Start with Docker
Docker Compose: Basic Setup (API + Ollama)
This configuration runs the Panguard API server with a local Ollama instance for Layer 2 AI analysis at zero cost.Docker Compose: Full Stack (Auth + Manager + Guard + Ollama)
This configuration runs the complete Panguard platform with authentication, fleet management, and local AI.Port Reference
| Port | Service | Protocol | Notes |
|---|---|---|---|
3000 | API Server (Auth + Web) | HTTP | Main entry point |
8443 | Manager Server | HTTP | Agent registration, heartbeats, SSE |
11434 | Ollama | HTTP | Local AI inference |
2222 | Trap: SSH Honeypot | TCP | Default SSH trap port |
8080 | Trap: HTTP Honeypot | TCP | Default HTTP trap port |
2121 | Trap: FTP Honeypot | TCP | Default FTP trap port |
4450 | Trap: SMB Honeypot | TCP | Default SMB trap port |
3307 | Trap: MySQL Honeypot | TCP | Default MySQL trap port |
3390 | Trap: RDP Honeypot | TCP | Default RDP trap port |
2323 | Trap: Telnet Honeypot | TCP | Default Telnet trap port |
Environment Variables
Guard Agent
| Variable | Default | Description |
|---|---|---|
PANGUARD_DATA_DIR | ./data | Data directory for baselines, logs, rules |
PANGUARD_MODE | learning | Guard mode: learning or protection |
OLLAMA_ENDPOINT | http://localhost:11434 | Ollama API endpoint |
ANTHROPIC_API_KEY | (none) | Claude API key for cloud AI |
OPENAI_API_KEY | (none) | OpenAI API key for cloud AI |
ABUSEIPDB_KEY | (none) | AbuseIPDB API key for threat intel |
Auth Server
| Variable | Default | Description |
|---|---|---|
PANGUARD_PORT | 3000 | API server port |
JWT_SECRET | (none) | JWT signing secret (required in production) |
GOOGLE_CLIENT_ID | (none) | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | (none) | Google OAuth client secret |
Manager
| Variable | Default | Description |
|---|---|---|
MANAGER_PORT | 8443 | Manager HTTP server port |
MANAGER_AUTH_TOKEN | (none) | Bearer token for API authentication |
MANAGER_MAX_AGENTS | 500 | Maximum registered agents |
Production Hardening
Docker Image Security
The production Docker image includes:- Multi-stage build — Build dependencies are not in the final image
- Non-root user — Runs as
panguard(UID 1001) - tini — Proper PID 1 signal handling and zombie reaping
- Minimal packages — Only
tiniandcurlin the final image
Required Capabilities
For Guard response actions to function inside Docker, grant these capabilities:Checklist
- Set
NODE_ENV=production(enables HSTS, disables wildcard CORS) - Generate strong secrets (
openssl rand -hex 32) - Use TLS termination (nginx/Caddy reverse proxy in front)
- Restrict network access to Manager port
- Mount secrets as env files, not inline environment variables
- Use named volumes for persistent data
- Configure log rotation for container logs
Log Locations (Inside Container)
| Component | Path | Format |
|---|---|---|
| Guard events | /data/events.jsonl | JSONL |
| Guard actions | /data/action-manifest.jsonl | JSONL |
| Guard baseline | /data/baseline.json | JSON |
| Application logs | stdout/stderr | Structured JSON |
Log Rotation
The ReportAgent handles log rotation automatically:| Setting | Default |
|---|---|
| Max file size | 50 MB |
| Max rotated files | 10 |
| Retention | 90 days |