RankFloRankFlo

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 -d

Environment Variables

Required

VariableDescription
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string
AUTH_SECRETRandom secret for signing sessions (min 32 chars)
AUTH_URLPublic URL of your RankFlo instance

Optional

VariableDefaultDescription
PORT3000HTTP server port
GITHUB_CLIENT_IDGitHub OAuth client ID
GITHUB_CLIENT_SECRETGitHub OAuth client secret
SMTP_HOSTSMTP server for email
S3_BUCKETS3-compatible bucket for media
S3_REGIONus-east-1S3 region
S3_ACCESS_KEYS3 access key
S3_SECRET_KEYS3 secret key
WEBHOOK_SECRETSecret for signing outbound webhooks

Production Checklist

Verify all items before going live.

  • AUTH_SECRET is 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 -d

Database migrations run automatically on startup. Always back up your database before upgrading.