Minimum System Requirements
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 2 GB | 4 GB |
| Disk | 20 GB | 40 GB |
- Docker 24+ and Docker Compose v2+
- A domain with DNS A record pointing to your server
- Ports 80 and 443 open (for web traffic and TLS)
Quick Start
The fastest way to get Sweetr running is with our deploy script. It will guide you through the setup, including creating a GitHub App with the correct permissions.- Check that Docker and Docker Compose are installed
- Ask for your domain and GitHub organization handle
- Generate a pre-filled URL to create a GitHub App with all required permissions
- Collect your GitHub App credentials
- Optionally configure Slack integration
- Generate
docker-compose.ymland.envfiles - Start the stack
SWEETR_TAG environment variable:
Manual Setup
If you prefer to set things up manually, follow the steps below.Prerequisites
Create a GitHub Application
You’ll need to create a GitHub application.Use our pre-filled link to speed this up — replace
YOUR_DOMAIN with your actual domain after opening it.After opening the link, you must also:- Uncheck “Expire user authorization tokens”
- Generate and set a Webhook Secret
- Submit the form, then generate a Client Secret
- Generate a Private Key (this downloads a
.pemfile)
Manual setup (without pre-filled link)
Manual setup (without pre-filled link)
- General
- Permissions & events
- Generate a Client Secret
- Callback URL:
https://your-domain.com/github/callback - Uncheck “Expire user authorization tokens”
- Check “Request user authorization (OAuth) during installation”
- Webhook
- Check “Active”
- Webhook URL:
https://your-domain.com/api/github/webhook - Generate and set a Webhook Secret
- SSL verification
- Check “Enable SSL verification”
- Generate a Private Key
Create a Slack App (Optional)
Create a Slack app at https://api.slack.com/apps/new:
- OAuth & Permissions
- Event Subscriptions
- Create a Redirect URL:
https://your-domain.com/settings/integrations/slack - Add the following Bot Token Scopes:
app_mentions:readchannels:joinchannels:readchat:writegroups:readim:readim:writempim:readreactions:readusers.profile:readusers:readusers:read.email
Create a Caddyfile
Create a
Caddyfile for the reverse proxy. Caddy automatically provisions and renews
HTTPS certificates via Let’s Encrypt.A public domain is required — GitHub cannot deliver webhooks to
localhost. For local development, use a tunnel like Cloudflare Tunnel or ngrok and use the tunnel URL as your domain.Configure environment variables
Create a
.env file. See the Environment Variables Reference below for all available options.Environment Variables Reference
API (sweetr/api)
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | — | PostgreSQL connection string |
REDIS_CONNECTION_STRING | Yes | — | Redis/Dragonfly connection string |
JWT_SECRET | Yes | — | Secret for signing JWT tokens |
FRONTEND_URL | Yes | — | URL of the web application |
PORT | No | 3000 | API server port |
GITHUB_APP_ID | Yes | — | GitHub App ID |
GITHUB_CLIENT_ID | Yes | — | GitHub OAuth Client ID |
GITHUB_CLIENT_SECRET | Yes | — | GitHub OAuth Client Secret |
GITHUB_APP_HANDLE | Yes | — | GitHub App slug (from the app URL) |
GITHUB_APP_PRIVATE_KEY | Yes | — | GitHub App private key (PEM format) |
GITHUB_WEBHOOK_SECRET | Yes | — | Secret for verifying GitHub webhooks |
GITHUB_OAUTH_REDIRECT_PATH | No | /github/callback | OAuth redirect path |
APP_MODE | No | self-hosted | self-hosted or saas |
NODE_ENV | No | production | development or production |
APP_ENV | No | production | development, staging, or production |
LOG_LEVEL | No | info | debug, info, warn, or error |
USE_SELF_SIGNED_SSL | No | false | Use self-signed SSL certificates |
BULLMQ_ENABLED | No | true | Enable background job processing |
SLACK_CLIENT_ID | No | "" | Slack Client ID |
SLACK_CLIENT_SECRET | No | "" | Slack Client Secret |
SLACK_WEBHOOK_SECRET | No | "" | Slack webhook verification secret |
STRIPE_API_KEY | No | "" | Stripe API key (cloud billing only) |
STRIPE_WEBHOOK_SECRET | No | "" | Stripe webhook secret (cloud billing only) |
SENTRY_DSN | No | "" | Sentry DSN for error tracking |
LOG_DRAIN | No | console | console or logtail |
LOGTAIL_TOKEN | No | "" | LogTail source token |
EMAIL_ENABLED | No | false | Enable transactional emails |
RESEND_API_KEY | No | "" | Resend API key for emails |
BULLBOARD_PATH | No | "" | URL path to access BullBoard dashboard |
BULLBOARD_USERNAME | No | "" | BullBoard login username |
BULLBOARD_PASSWORD | No | "" | BullBoard login password |
CRON_GITHUB_RETRY_FAILED_WEBHOOKS_EVERY_MINUTES | No | 30 | Retry interval for failed webhooks |
Web (sweetr/web)
| Variable | Required | Default | Description |
|---|---|---|---|
API_ENDPOINT | Yes | — | Full URL to the API (e.g., https://sweetr.example.com/api) |
AUTH_COOKIE_DOMAIN | Yes | — | Domain for auth cookies (e.g., example.com) |
GITHUB_APP | Yes | — | GitHub App slug (same as GITHUB_APP_HANDLE) |
SENTRY_DSN | No | "" | Sentry DSN for frontend error tracking |
APP_ENV | No | production | Environment name for Sentry |
Upgrading
To upgrade to a new version:latest, edit the image tags in docker-compose.yml:
Monitoring (Optional)
Sentry
Add to your API.env:
.env:
SENTRY_DSN environment variable.
LogTail
BullBoard (Job Queue Dashboard)
To enable the BullBoard dashboard for monitoring background jobs:https://your-domain.com/api/bullboard.
Troubleshooting
API fails to start
Check the container logs:- Database connection failed: Ensure Postgres is healthy with
docker compose ps. The API waits for migrations to run on startup. - Missing environment variables: The API will log which required variables are missing.
- Redis connection failed: Ensure Dragonfly is healthy. Check that
REDIS_CONNECTION_STRINGuses the Docker service name (e.g.,redis://dragonfly:6379).
Web app shows blank page
Check the browser console for errors. Common causes:API_ENDPOINTis wrong: Make sure it’s the full URL reachable from the browser (not an internal Docker hostname).- CORS errors: Ensure
FRONTEND_URLon the API matches the URL you’re accessing the web app from.
Database migration errors
If migrations fail on startup, check the API logs. You may need to connect to Postgres directly:Port conflicts
If port 80 or 443 is already in use, either stop the conflicting service or change the Caddy port mappings indocker-compose.yml:
Caddyfile to match (e.g., :8080 {) and adjust FRONTEND_URL and API_ENDPOINT in .env accordingly.