Self-Hosting Guide
Run HookSniff on your own infrastructure. One-command setup with Docker.
Quick Setup
# 1. Clone the repo
git clone https://github.com/servetarslan02/HookSniff.git
cd HookSniff
# 2. Start everything with one command
make self-hostThis command copies .env.example โ .env, builds Docker images, starts all services, and runs health checks.
Services
| Service | Port | Description |
|---|---|---|
| docs.dashboard | 3001 | Web UI |
| API | 3000 | REST API |
| PostgreSQL | 5432 | Database |
| Redis | 6379 | Cache + Queue |
Environment Variables
Configure via .env file:
# Database (don't change if using Docker PostgreSQL)
DATABASE_URL=postgresql://hooksniff:hooksniff@postgres:5432/hooksniff
# Redis (don't change if using Docker Redis)
REDIS_URL=redis://redis:6379
# JWT Secret (CHANGE THIS!)
JWT_SECRET=rastgele-64-karakter-hex-string
# HMAC Secret (CHANGE THIS!)
HMAC_SECRET=rastgele-64-karakter-hex-string
# API Base URL (your domain in production)
API_BASE_URL=http://localhost:3000
DASHBOARD_URL=http://localhost:3001Generate secrets: make generate-secret
Docker Compose
# Start
docker compose up -d --build
# Stop
docker compose down
# Reset database
docker compose down -v
docker compose up -d --buildManagement Commands
# Status check
make self-host-status
# Database backup
make self-host-backup
# Update (git pull + rebuild)
make self-host-update
# View logs
make logs
# Single service logs
make logs-api
make logs-worker
make logs-dbCloud Deployment
For production, set up a reverse proxy with SSL:
Nginx Reverse Proxy
server {
server_name hooksniff.example.com;
location / {
proxy_pass http://localhost:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
server_name api.hooksniff.example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}SSL with Let's Encrypt
sudo certbot --nginx -d hooksniff.example.com -d api.hooksniff.example.comFirewall
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enableTroubleshooting
# Check service status
make status
# View logs
make logs
# Auto-fix common issues
make fix
# Nuclear reset
make reset
# Check port conflicts
sudo lsof -i :3000
sudo lsof -i :3001
# Database shell
make db-shell