Deploying IHateMoney
Introduction
IHateMoney is a simple, elegant web application for managing shared expenses. Whether you’re splitting bills with roommates, tracking expenses on a group trip, or managing shared costs with friends, IHateMoney makes it easy to keep track of who paid what, when, and for whom - then calculates the optimal way to settle up.
Built with Python and Flask, IHateMoney provides a straightforward interface that focuses on getting the job done without unnecessary complexity. The application supports multiple projects (expense groups), automatic balance calculations, and even generates QR codes for easy mobile access.
Key highlights of IHateMoney:
- Simple Interface: Clean, intuitive design for adding and managing expenses
- Smart Settlements: Automatically calculates the minimum number of transactions to settle all debts
- Multiple Projects: Create separate projects for different groups or trips
- Weight System: Support for uneven splitting based on participation
- Multi-Currency: Track expenses in different currencies
- Email Notifications: Invite participants via email
- Statistics: View spending breakdowns by person and category
- Export Options: Export data in JSON and CSV formats
- API Access: RESTful API for integration with other tools
- Self-Hosted Privacy: Your financial data stays on your infrastructure
- Mobile Friendly: Responsive design works on phones and tablets
This guide walks through deploying IHateMoney on Klutch.sh using Docker, setting up a private expense tracking system for you and your groups.
Why Deploy IHateMoney on Klutch.sh
Deploying IHateMoney on Klutch.sh provides several advantages for expense management:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds IHateMoney without manual server configuration. Push to GitHub and your expense tracker deploys automatically.
Persistent Storage: Attach persistent volumes for your database. Your expense history survives container restarts and redeployments.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your financial data.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.
Privacy Focused: Keep your expense data on infrastructure you control, not on third-party services.
Custom Domains: Assign a custom domain for easy sharing with your expense groups.
Always Available: Access your expense data from anywhere, anytime, without managing your own server hardware.
Prerequisites
Before deploying IHateMoney on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your IHateMoney configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) An SMTP server for email notifications
Understanding IHateMoney Architecture
IHateMoney is built on a straightforward stack:
Flask Application: The Python-based web application handles all business logic and serves the web interface.
SQLAlchemy ORM: Database abstraction supporting SQLite (default) or PostgreSQL/MySQL for production.
Jinja2 Templates: Server-side rendering for the responsive web interface.
RESTful API: Programmatic access for mobile apps or integrations.
Preparing Your Repository
To deploy IHateMoney on Klutch.sh, create a GitHub repository containing your Dockerfile.
Repository Structure
ihatemoney-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM ihatemoney/ihatemoney:latest
# Set environment variablesENV SECRET_KEY=${SECRET_KEY}ENV SQLALCHEMY_DATABASE_URI=${SQLALCHEMY_DATABASE_URI:-sqlite:////database/ihatemoney.db}
# Admin configurationENV ACTIVATE_ADMIN_DASHBOARD=${ACTIVATE_ADMIN_DASHBOARD:-True}ENV ADMIN_PASSWORD=${ADMIN_PASSWORD}
# Project creation settingsENV ALLOW_PUBLIC_PROJECT_CREATION=${ALLOW_PUBLIC_PROJECT_CREATION:-True}ENV ACTIVATE_DEMO_PROJECT=${ACTIVATE_DEMO_PROJECT:-False}
# Email configuration (optional)ENV MAIL_SERVER=${MAIL_SERVER:-}ENV MAIL_PORT=${MAIL_PORT:-587}ENV MAIL_USERNAME=${MAIL_USERNAME:-}ENV MAIL_PASSWORD=${MAIL_PASSWORD:-}ENV MAIL_USE_TLS=${MAIL_USE_TLS:-True}ENV MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER:-}
# Create database directoryRUN mkdir -p /database
# Expose port 8000EXPOSE 8000
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8000/ || exit 1
# Volume for databaseVOLUME ["/database"]Environment Variables Reference
IHateMoney uses environment variables for configuration:
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY | Yes | - | Flask secret key for session signing |
SQLALCHEMY_DATABASE_URI | No | sqlite:///… | Database connection string |
ACTIVATE_ADMIN_DASHBOARD | No | True | Enable admin dashboard |
ADMIN_PASSWORD | No | - | Hashed admin password |
ALLOW_PUBLIC_PROJECT_CREATION | No | True | Allow anyone to create projects |
ACTIVATE_DEMO_PROJECT | No | False | Enable demo project for testing |
MAIL_SERVER | No | - | SMTP server hostname |
MAIL_PORT | No | 587 | SMTP server port |
MAIL_USERNAME | No | - | SMTP authentication username |
MAIL_PASSWORD | No | - | SMTP authentication password |
MAIL_USE_TLS | No | True | Use TLS for SMTP |
MAIL_DEFAULT_SENDER | No | - | Default from address for emails |
Deploying IHateMoney on Klutch.sh
Once your repository is prepared, follow these steps to deploy IHateMoney:
- Select HTTP as the traffic type
- Set the internal port to 8000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the IHateMoney container
- Provision an HTTPS certificate
Generate Your Secret Key
Generate a secure secret key for Flask:
openssl rand -hex 32Save this key for the environment variables configuration.
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignoregit commit -m "Initial IHateMoney deployment configuration"git remote add origin https://github.com/yourusername/ihatemoney-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “expenses” or “ihatemoney”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your IHateMoney Dockerfile.
Configure HTTP Traffic
IHateMoney serves its web interface over HTTP. In the deployment settings:
Set Environment Variables
In the environment variables section, add the following:
| Variable | Value |
|---|---|
SECRET_KEY | Your generated secret key |
ACTIVATE_ADMIN_DASHBOARD | True |
ALLOW_PUBLIC_PROJECT_CREATION | True (or False for restricted use) |
For email notifications, also add:
| Variable | Value |
|---|---|
MAIL_SERVER | Your SMTP server |
MAIL_PORT | 587 |
MAIL_USERNAME | Your SMTP username |
MAIL_PASSWORD | Your SMTP password |
MAIL_DEFAULT_SENDER | noreply@yourdomain.com |
Attach Persistent Volumes
Persistent storage is essential for your expense data. Add the following volume:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/database | 1 GB | SQLite database storage |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access IHateMoney
Once deployment completes, access your IHateMoney instance at https://your-app-name.klutch.sh. You can immediately start creating expense projects.
Using IHateMoney
Creating a Project
- Navigate to your IHateMoney instance
- Click “Start a new project” or access the demo project
- Enter a project name and identifier
- Set a private code (password) for the project
- Add email if you want to receive invitations
Adding Members
- Open your project
- Click “Add a member”
- Enter each participant’s name
- Optionally set a default weight for uneven splitting
Recording Expenses
- Click “Add a new bill”
- Enter:
- Date: When the expense occurred
- What: Description of the expense
- Payer: Who paid
- Amount: How much was spent
- For whom: Who benefited (check participants)
- Click “Add” to save
Viewing Balances
The main project page shows:
- Current balances for each member
- Suggested settlements to resolve debts
- List of all recorded expenses
Settling Up
IHateMoney calculates the optimal way to settle:
- View the “Settlement” section
- Follow the suggested payments
- Mark debts as settled when paid
Advanced Features
Using Weights
For uneven splitting (e.g., one person ate more):
- When adding a bill, expand “For whom”
- Adjust weights for each participant
- Expenses are split proportionally
Multi-Currency Projects
Track expenses in different currencies:
- When creating a project, select a default currency
- Add bills with amounts in any currency
- IHateMoney converts for balance calculations
Exporting Data
Export your project data:
- Access the project
- Click “Export” in the menu
- Choose JSON or CSV format
- Download for backup or analysis
Admin Dashboard
Access administrative features:
- Navigate to
/adminon your instance - Enter admin password
- Manage projects and users
Email Configuration
Enabling Invitations
With SMTP configured, members can:
- Receive project invitation emails
- Get notifications of new expenses
- Receive settlement reminders
SMTP Setup Examples
For Gmail:
MAIL_SERVER=smtp.gmail.comMAIL_PORT=587MAIL_USE_TLS=TrueFor SendGrid:
MAIL_SERVER=smtp.sendgrid.netMAIL_PORT=587MAIL_USERNAME=apikeyTroubleshooting Common Issues
Cannot Create Projects
Symptoms: “Project creation is disabled” error.
Solutions:
- Set
ALLOW_PUBLIC_PROJECT_CREATION=True - Or create projects via admin dashboard
Emails Not Sending
Symptoms: Invitations and notifications don’t arrive.
Solutions:
- Verify SMTP credentials are correct
- Check MAIL_PORT and MAIL_USE_TLS settings
- Review container logs for SMTP errors
- Test with a mail service that provides delivery logs
Database Errors
Symptoms: Application errors related to database.
Solutions:
- Ensure volume is properly mounted
- Check write permissions on database directory
- Verify database file isn’t corrupted
Session Errors
Symptoms: Being logged out frequently.
Solutions:
- Ensure SECRET_KEY remains constant across deployments
- Don’t change SECRET_KEY after deployment
Additional Resources
- Official IHateMoney Website
- IHateMoney Documentation
- IHateMoney GitHub Repository
- IHateMoney Docker Image
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying IHateMoney on Klutch.sh gives you a private, self-hosted expense sharing solution with automatic builds, persistent storage, and secure HTTPS access. You maintain full control over your financial data while enjoying a clean, functional interface for tracking shared expenses.
Whether you’re managing household expenses with roommates, tracking costs on a group vacation, or splitting bills with friends, IHateMoney on Klutch.sh provides a simple, reliable way to keep everyone’s finances in order without the awkwardness of money conversations.