Campfire is a self-hosted, web-based chat application designed for teams that need a secure, private communication platform. Built with Ruby on Rails, it provides essential chat features including multiple rooms with access controls, direct messaging, file uploads with previews, search, and real-time notifications via Web Push. Unlike multi-tenant platforms like Slack or Discord, Campfire is explicitly single-tenant—each deployment serves one organization or customer group. This makes it ideal for businesses requiring data sovereignty, compliance control, or custom branding without relying on third-party services. The application is designed for easy deployment via Docker, making it accessible to DevOps teams and system administrators who prefer full control over their infrastructure.
What You Get
- Multiple rooms with access controls - Create private and public chat rooms where administrators can manage user permissions and restrict access to specific groups.
- Direct messages - Enable private one-on-one conversations between users without exposing them to public channels.
- File attachments with previews - Upload and view files directly in the chat interface, with automatic thumbnail generation for images and document previews.
- Search functionality - Full-text search across messages and files to quickly retrieve past conversations or shared documents.
- Web Push notifications - Deliver real-time browser notifications using the Web Push API, requiring VAPID keypair configuration for push subscription.
- API and bot integrations - Extend functionality via a built-in API to integrate bots, automate responses, or connect with other internal tools.
- Docker-based single-machine deployment - All components (web app, background jobs, caching, file serving, and SSL) are containerized for easy, repeatable deployments.
- Automatic SSL via Let’s Encrypt - Enable HTTPS automatically by setting the SSL_DOMAIN environment variable, removing manual certificate management.
Common Use Cases
- Building a secure internal team chat for compliance-sensitive industries - Healthcare or finance teams deploy Campfire on-premises to ensure all communications remain within their network, meeting HIPAA or GDPR requirements.
- Creating a branded customer support chat for enterprise clients - SaaS companies deploy separate Campfire instances per client, offering a white-labeled communication channel with no third-party data sharing.
- Problem → Solution flow: Need a self-hosted alternative to Slack without complex infrastructure? - Campfire provides a ready-to-deploy Docker image with built-in SSL, file storage, and background job processing—eliminating the need to manage separate Redis, Sidekiq, or Nginx configurations manually.
- Team/workflow scenario: DevOps teams managing isolated environments for multiple clients - Each client gets their own Campfire instance deployed via Docker, with dedicated storage volumes and domain-specific SSL certificates for secure, independent communication channels.
Under The Hood
This project is a real-time chat platform built on Ruby on Rails, designed to support dynamic user interactions through WebSocket integration and a responsive UI. It combines traditional MVC patterns with modern web technologies to deliver a feature-rich messaging experience with extensibility and developer-friendly tools.
Architecture
It follows a monolithic Rails architecture with clear separation of concerns and well-defined modules for core functionalities. The system leverages ActionCable for real-time communication, integrating with Redis and SQLite for data handling.
- Uses MVC architecture with modular organization to support chat rooms, user presence, and messaging features
- Implements ActionCable channels for handling real-time updates such as typing indicators and read status
- Supports extensible design patterns that allow for bot integrations and custom UI components
- Maintains a balance between simplicity and scalability in its structural approach
Tech Stack
It is built using Ruby on Rails with a suite of modern tools and libraries to enhance functionality and developer workflow.
- Built in Ruby with Rails, enhanced by Hotwire for dynamic UI rendering
- Integrates Redis and SQLite for caching, real-time communication, and data persistence
- Leverages Docker for containerization and GitHub Actions for CI/CD automation
- Employs Capybara, Selenium, and Mocha for comprehensive testing with RuboCop and Brakeman for linting and security
Code Quality
It demonstrates a mature codebase with consistent patterns and a strong emphasis on maintainability and test coverage.
- Comprehensive testing practices cover both unit and integration layers with robust test helpers
- Error handling is consistently implemented across modules, using custom error classes and rescue blocks
- Code style remains reasonably consistent, though some legacy patterns and duplicated logic are present
- Linting and security checks are enforced to uphold code quality standards
What Makes It Unique
This project distinguishes itself through deep real-time communication integration and extensibility features that are uncommon in traditional Rails apps.
- Real-time presence and messaging are handled via custom ActionCable channels with minimal latency
- Bot integrations are supported through dedicated endpoints and key management for programmatic moderation
- Progressive Web App (PWA) capabilities are included with service workers and manifest support for offline experiences
- Component-based styling and asset pipeline usage enable highly customizable themes with minimal code changes