| order | 1 |
|---|
Deploy OpsKnight with Docker Compose. This is the fastest way to run the platform locally and is suitable for small production environments.
- Docker Engine 20+
- Docker Compose 2+
- PostgreSQL (included in Compose by default)
# Clone repository
git clone https://github.com/dushyant-rahangdale/opsknight.git
cd opsknight
# Configure
cp env.example .env
# Start services
docker compose up -dOpen http://localhost:3000 — you'll be directed to /setup to create your admin account.
Set the core variables in .env:
DATABASE_URL=postgresql://opsknight:password@postgres:5432/opsknight_db
NEXTAUTH_URL=https://your-domain.com
NEXTAUTH_SECRET=your-32-char-secretImportant:
NEXTAUTH_URLmust match the exact base URL users will access.
Generate a secret:
openssl rand -base64 32| File | Purpose |
|---|---|
docker-compose.yml |
Standard deployment |
docker-compose.dev.yml |
Development with hot reload |
docker-compose.prod.yml |
Production optimizations |
- Use a strong database password.
- Set
NEXTAUTH_URLto your public HTTPS domain. - Configure SMTP/SMS providers in Settings → Notifications.
- Put a reverse proxy in front of the app for TLS termination.
server {
listen 443 ssl;
server_name ops.yourcompany.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
}
}# Pull latest changes
git pull
# Update images
docker compose pull
# Restart containers
docker compose up -d# Database backup
docker exec opsknight_postgres pg_dump -U opsknight opsknight_db > backup.sql
# Restore
cat backup.sql | docker exec -i opsknight_postgres psql -U opsknight opsknight_dbdocker compose logs -f app
docker compose logs -f postgresdocker compose down -v
docker compose up -d- Confirm
http://localhost:3000loads. - Log in with the admin user.
- Create a test service to validate DB writes.