Deploying Hitobito
Introduction
Hitobito is a comprehensive open-source member and event management system designed for associations, clubs, and organizations. Originally developed for Swiss youth organizations, it has grown to support various types of membership organizations with complex hierarchical structures.
Built with Ruby on Rails, Hitobito provides powerful features for managing people, groups, events, courses, mailings, and more. Its flexible role and permission system allows organizations to model their specific structures while maintaining proper access control.
Key highlights of Hitobito:
- Member Management: Comprehensive person and contact management
- Group Hierarchies: Model complex organizational structures
- Event Management: Create and manage events, courses, and registrations
- Role-Based Access: Flexible permissions based on organizational roles
- Mailing Lists: Integrated email distribution lists
- Course Management: Training and certification tracking
- Export Features: CSV, PDF, and label exports
- Invoicing: Basic invoicing and payment tracking
- Multi-Tenant: Host multiple organizations
- API Access: REST API for integrations
- Customizable: Wagon system for organization-specific extensions
- Open Source: Licensed under AGPL-3.0
This guide walks through deploying Hitobito on Klutch.sh using Docker.
Why Deploy Hitobito on Klutch.sh
Deploying Hitobito on Klutch.sh provides several advantages:
Organization Access: Members can access from anywhere.
Centralized Data: Single source of truth for member information.
HTTPS Security: Secure handling of personal member data.
Reliable Hosting: Professional infrastructure for critical organization data.
Automatic Updates: Deploy updates without downtime concerns.
Prerequisites
Before deploying Hitobito on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- PostgreSQL database (deployed separately or external service)
- Basic familiarity with Docker and Ruby on Rails
- Understanding of your organization’s structure
Understanding Hitobito Architecture
Hitobito consists of several components:
Rails Application: Core web application handling business logic.
Background Workers: Delayed job processing for emails and exports.
PostgreSQL: Primary database for all data.
Redis: Optional caching and session storage.
Sphinx/Thinking Sphinx: Full-text search (optional).
Wagon System: Organization-specific customizations.
Preparing Your Repository
Create a GitHub repository with your Hitobito configuration.
Repository Structure
hitobito-deploy/├── Dockerfile├── config/│ └── database.yml└── .dockerignoreCreating the Dockerfile
FROM ruby:3.1-alpine
# Install dependenciesRUN apk add --no-cache \ build-base \ postgresql-dev \ nodejs \ yarn \ tzdata \ git \ imagemagick
WORKDIR /app
# Clone Hitobito coreRUN git clone https://github.com/hitobito/hitobito.git .
# Install gemsRUN bundle install --without development test
# Precompile assetsRUN bundle exec rake assets:precompile
# Set environment variablesENV RAILS_ENV=productionENV RAILS_SERVE_STATIC_FILES=trueENV DATABASE_URL=${DATABASE_URL}ENV SECRET_KEY_BASE=${SECRET_KEY_BASE}
# Expose portEXPOSE 3000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
# Start applicationCMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]Environment Variables Reference
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
SECRET_KEY_BASE | Yes | Rails secret key |
RAILS_ENV | No | Rails environment (default: production) |
SMTP_ADDRESS | No | SMTP server for emails |
SMTP_PORT | No | SMTP port |
SMTP_USERNAME | No | SMTP username |
SMTP_PASSWORD | No | SMTP password |
Deploying Hitobito on Klutch.sh
- Deploy PostgreSQL on Klutch.sh or use managed service
- Create a database for Hitobito
- Note the connection string
- Select HTTP as the traffic type
- Set the internal port to 3000
Deploy PostgreSQL
Hitobito requires PostgreSQL:
Generate Secret Key
Create a secure secret key:
openssl rand -hex 64Push Your Repository to GitHub
Commit your Dockerfile and configuration to GitHub.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “hitobito” or “members”.
Create a New App
Create a new app and connect your GitHub repository.
Configure HTTP Traffic
Set up HTTP traffic:
Set Environment Variables
| Variable | Value |
|---|---|
DATABASE_URL | Your PostgreSQL connection string |
SECRET_KEY_BASE | Your generated secret key |
RAILS_ENV | production |
Attach Persistent Volumes
| Mount Path | Size | Purpose |
|---|---|---|
/app/storage | 10 GB | Uploaded files |
/app/log | 1 GB | Application logs |
Deploy Your Application
Click Deploy to build and launch Hitobito.
Run Database Setup
After deployment, run migrations:
bundle exec rails db:migratebundle exec rails db:seedAccess Your Instance
Navigate to your app URL and log in with the default admin account.
Initial Configuration
Admin Setup
- Log in with default credentials
- Change admin password immediately
- Configure organization settings
Group Structure
Define your organization’s hierarchy:
- Go to Groups
- Create top-level group
- Add sub-groups
- Define group types
Role Configuration
Set up roles for your organization:
- Define role types
- Set permissions per role
- Configure role requirements
Member Management
Adding People
- Go to People
- Click “New Person”
- Enter details:
- Name
- Contact information
- Group memberships
- Roles
- Save person
Group Memberships
Assign people to groups:
- Primary group
- Additional groups
- Role in each group
- Membership dates
Role Assignment
Roles determine permissions:
- Leaders
- Members
- Administrators
- Custom roles
Event Management
Creating Events
- Go to Events
- Click “New Event”
- Enter:
- Title
- Dates
- Location
- Description
- Max participants
- Configure registration
Course Management
For training events:
- Create course type
- Add prerequisites
- Track completions
- Issue certifications
Registrations
Manage event participation:
- Online registration
- Waiting lists
- Attendance tracking
- Confirmation emails
Mailing Features
Mailing Lists
Create distribution lists:
- Go to Mailing Lists
- Create list
- Define subscribers (by group/role)
- Configure settings
Bulk Mailings
Send emails to groups:
- Select recipients
- Compose message
- Send or schedule
Export Features
People Exports
Export member data:
- CSV format
- PDF lists
- Labels for printing
Event Exports
Export event data:
- Participant lists
- Attendance reports
- Financial summaries
Invoicing
Creating Invoices
- Go to Invoices
- Create invoice
- Add line items
- Send to member
Payment Tracking
Track payments:
- Mark as paid
- Partial payments
- Payment reminders
Wagon System
Organization-Specific Features
Hitobito uses “wagons” for customization:
- Custom fields
- Additional roles
- Specific workflows
- Branding
Available Wagons
- PBS (Pfadibewegung Schweiz)
- CEVI
- Jubla
- Generic
API Access
REST API
Hitobito provides a REST API:
# Authenticatecurl -X POST https://your-app.klutch.sh/oauth/token \ -d "grant_type=password&username=user&password=pass"
# Get peoplecurl -H "Authorization: Bearer TOKEN" \ https://your-app.klutch.sh/api/peopleJSON:API Format
API follows JSON:API specification for consistent responses.
Security Considerations
Data Privacy
Hitobito handles personal data:
- Configure retention policies
- Enable consent tracking
- Implement data export
- Support right to deletion
Access Control
Review permissions:
- Audit role access
- Limit admin accounts
- Review group access
Backup Strategy
Database Backup
Regular PostgreSQL backups:
pg_dump hitobito_production > backup.sqlFile Backup
Back up uploaded files from /app/storage.
Troubleshooting
Application Errors
- Check Rails logs
- Review stack traces
- Verify database connection
Performance Issues
- Optimize database queries
- Enable caching
- Review background jobs
Email Delivery
- Verify SMTP settings
- Check email logs
- Test with simple message
Additional Resources
Conclusion
Deploying Hitobito on Klutch.sh provides a professional member management solution for associations and organizations. With comprehensive features for people management, events, and communication, Hitobito serves as a central hub for organizational administration.
The combination of Hitobito’s powerful features and Klutch.sh’s reliable hosting creates an ideal platform for managing membership organizations of any size.