Self-Hosting
Run RankFlo on your own infrastructure. This guide covers Docker Compose setup, required environment variables, and production best practices.
Docker Compose
The fastest way to self-host RankFlo:
yaml
version: "3.9"
services:
web:
image: ghcr.io/rankflo/rankflo:latest
ports:
- "3000:3000"
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: rankflo
POSTGRES_PASSWORD: rankflo
POSTGRES_DB: rankflo
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rankflo"]
interval: 5s
restart: unless-stopped
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
restart: unless-stopped
volumes:
postgres_data:
redis_data:bash
docker compose up -dEnvironment Variables
Required
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
REDIS_URL | Redis connection string |
AUTH_SECRET | Random secret for signing sessions (min 32 chars) |
AUTH_URL | Public URL of your RankFlo instance |
Optional
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | HTTP server port |
GITHUB_CLIENT_ID | — | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET | — | GitHub OAuth client secret |
SMTP_HOST | — | SMTP server for email |
S3_BUCKET | — | S3-compatible bucket for media |
S3_REGION | us-east-1 | S3 region |
S3_ACCESS_KEY | — | S3 access key |
S3_SECRET_KEY | — | S3 secret key |
WEBHOOK_SECRET | — | Secret for signing outbound webhooks |
Production Checklist
Verify all items before going live.
AUTH_SECRETis a cryptographically random string (min 32 chars)- PostgreSQL has connection pooling (PgBouncer)
- Redis persistence enabled (
appendonly yes) - HTTPS terminated at reverse proxy (nginx, Caddy)
- S3 or compatible storage configured for media
- Transactional email configured (SMTP or Resend/Postmark)
- PostgreSQL backups scheduled
Reverse Proxy
A minimal nginx configuration:
nginx
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /etc/ssl/certs/your-domain.pem;
ssl_certificate_key /etc/ssl/private/your-domain.key;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Updating
bash
docker compose pull
docker compose up -dDatabase migrations run automatically on startup. Always back up your database before upgrading.