VPS Hardening¶
Checklist for running AlexClaw on a virtual private server.
Firewall¶
Only expose what's needed:
# Allow SSH, HTTP, HTTPS
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
# Everything else is blocked by default
# Do NOT expose 5001, 5432, 4369, 8000
Docker Security¶
- Run containers as non-root (AlexClaw's Dockerfile already does this)
- Don't mount the Docker socket into containers
- Use Docker's built-in network isolation
- Keep Docker and images updated
Secrets Management¶
- Use
.envfile withchmod 600permissions - Never commit
.envto version control - Generate strong secrets:
# SECRET_KEY_BASE
openssl rand -base64 64
# DATABASE_PASSWORD
openssl rand -base64 32
# CLUSTER_COOKIE
openssl rand -base64 32
# MCP API key
openssl rand -base64 32
Backups¶
Configure automated database backups:
- Set
BACKUP_DIRto a path outside the Docker data directory - Create a workflow:
db_backup→telegram_notify - Schedule it via cron (e.g., daily at 03:00)
- Enable in Admin > Config:
backup.enabled = true
Also consider:
- Periodic off-site backup copies (rsync, S3, etc.)
- Test restore procedures regularly
Monitoring¶
/healthendpoint for uptime monitoring (supports any HTTP checker)/metricsendpoint for detailed system stats (authenticated)- Telegram notifications for circuit breaker events and workflow failures
- Docker healthcheck is built into the Dockerfile
Updates¶
Migrations run automatically on container start.