A community-driven fork of Small Bets that makes it easy to run your own branded community. All branding (app name, logos, colors, emails) is configurable through environment variables—no code changes required.
Based on Once Campfire, a Ruby on Rails chat application built by 37signals, with additional features from Small Bets. See smallbets-mods.md for a list of modifications.
This project combines the simplicity of Campfire with optional payment gating, passwordless authentication, and community features. Perfect for running paid memberships, course communities, or private group chats.
If you find a bug or have a feature request, please post an issue. Contributions welcome!
- Ruby 3.4.5 (check with
ruby --version) - Redis server
- SQLite3
- Node.js with npm (or bun) for Tailwind CSS builds
To run your own branded community, copy .env.sample to .env and configure:
APP_NAME="Your Community Name"
APP_HOST="chat.yourdomain.com"
SUPPORT_EMAIL="[email protected]"
MAILER_FROM_NAME="Your Community"
MAILER_FROM_EMAIL="[email protected]"See BRANDING.md for complete customization options.
bin/setupStart the app in development:
bin/devThis starts both the Rails server and Vite dev server using Foreman (via Procfile.dev).
The bin/setup script installs Ruby gems and Node packages (via npm install), prepares the database, and configures the application.
If you skip bin/setup, install frontend dependencies manually with npm install.
All CSS is managed through Vite. Tailwind processes styles from app/frontend/entrypoints/application.css, which is automatically rebuilt during development.
Campfire-CE uses Kamal for deployment. A modern tool that provides zero-downtime deployments with Docker.
- A Linux server (Ubuntu 20.04+ recommended)
- Docker installed on the server
- A domain name pointing to your server
- Docker Hub account (or another container registry)
- Kamal CLI installed locally (install via
gem install kamal)
-
Initialize Kamal (creates
.kamal/secretsif missing):kamal init
-
Configure environment variables: Edit
.kamal/secretsand add your production secrets, for example:# Registry KAMAL_REGISTRY_PASSWORD=your-docker-hub-password REGISTRY_USERNAME=your-docker-hub-username # Server + domain SERVER_IP=your-server-ip PROXY_HOST=your-domain.com # Application secrets (generate with: rails secret) SECRET_KEY_BASE=your-rails-secret-key RESEND_API_KEY=your-resend-api-key AWS_ACCESS_KEY_ID=your-aws-access-key AWS_SECRET_ACCESS_KEY=your-aws-secret-key AWS_DEFAULT_REGION=us-east-1 VAPID_PUBLIC_KEY=your-vapid-public-key VAPID_PRIVATE_KEY=your-vapid-private-key WEBHOOK_SECRET=your-webhook-secret COOKIE_DOMAIN=your-domain.com # Optional features GUMROAD_ON=false
-
Initial deployment:
kamal setup # Sets up Docker, builds image, starts services
kamal deploy # Zero-downtime deploymentThis repository includes GitHub Actions for automatic deployment:
-
Set GitHub Secrets in your repository settings:
SSH_PRIVATE_KEY- SSH key for server accessSERVER_IP- Your production server IPDOMAIN- Your domain name (PROXY_HOST)DOCKER_USERNAME&DOCKER_PASSWORD- Docker Hub credentialsSECRET_KEY_BASE- Rails encryption keyRESEND_API_KEY- Email delivery serviceAWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY- File storageAWS_DEFAULT_REGION- AWS region (default: us-east-1)VAPID_PUBLIC_KEY&VAPID_PRIVATE_KEY- Push notificationsWEBHOOK_SECRET- Webhook securityCOOKIE_DOMAIN- Your domain for cookies- Optional:
GUMROAD_ACCESS_TOKEN,GUMROAD_ON,GUMROAD_PRODUCT_IDS
-
Deploy automatically:
- Push to
masterbranch for automatic deployment - Or use "Deploy with Kamal" workflow for manual deployment
- Push to
If you prefer not to use Kamal, you can deploy manually with Docker:
# Build and run
docker build -t campfire-ce .
docker run -p 3000:3000 \
-e RAILS_ENV=production \
-e SECRET_KEY_BASE=your-secret-key \
-v /path/to/storage:/rails/storage \
campfire-ce| Variable | Purpose | Required |
|---|---|---|
SECRET_KEY_BASE |
Rails encryption key | ✅ |
RESEND_API_KEY |
Email delivery via Resend | ✅ |
AWS_ACCESS_KEY_ID |
File storage on AWS | ✅ |
AWS_SECRET_ACCESS_KEY |
File storage on AWS | ✅ |
AWS_DEFAULT_REGION |
AWS region (us-east-1) | ✅ |
VAPID_PUBLIC_KEY |
Web push notifications | ✅ |
VAPID_PRIVATE_KEY |
Web push notifications | ✅ |
WEBHOOK_SECRET |
Webhook security | ✅ |
COOKIE_DOMAIN |
Session cookies domain | ✅ |
GUMROAD_ACCESS_TOKEN |
Payment processing | |
GUMROAD_ON |
Enable Gumroad features | |
GUMROAD_PRODUCT_IDS |
Gumroad product IDs |
✅ = Required for production deployment
IMPORTANT: Campfire-CE does not include automatic database backups out of the box. You must implement your own backup strategy.
Recommended Options:
-
Volume Snapshots - Use your cloud provider's snapshot feature (DigitalOcean, AWS, etc.)
-
Periodic Backups - Schedule cron jobs or scripts to backup the SQLite database:
# Example: Daily backup at 2 AM 0 2 * * * tar -czf /backups/campfire-$(date +\%Y\%m\%d).tar.gz /disk/campfire/db/production.sqlite3
See DEPLOYMENT.md for detailed backup strategies.