How to Self-Host IHateMoney with Docker Compose
What Is IHateMoney?
IHateMoney is a self-hosted web app for tracking shared expenses in groups. Add who paid what, and it calculates who owes whom and the minimum number of transactions to settle up. It replaces Splitwise for roommates, travel groups, or anyone splitting costs — without giving a third party access to your spending data.
Prerequisites
- A Linux server (Ubuntu 22.04+ recommended)
- Docker and Docker Compose installed (guide)
- 128 MB of free RAM
- A domain name (optional, for remote access)
Docker Compose Configuration
Create a docker-compose.yml file:
services:
ihatemoney:
image: ihatemoney/ihatemoney:7.0.1
container_name: ihatemoney
restart: unless-stopped
ports:
- "8000:8000"
volumes:
- ihatemoney_data:/database
- ./ihatemoney.cfg:/etc/ihatemoney/ihatemoney.cfg:ro
environment:
- IHATEMONEY_SETTINGS_FILE_PATH=/etc/ihatemoney/ihatemoney.cfg
networks:
- ihatemoney
networks:
ihatemoney:
volumes:
ihatemoney_data:
Create the configuration file ihatemoney.cfg:
# IHateMoney configuration
SECRET_KEY = "change-this-to-a-random-secret-string"
SQLALCHEMY_DATABASE_URI = "sqlite:////database/ihatemoney.db"
ALLOW_PUBLIC_PROJECT_CREATION = True
ADMIN_PASSWORD = "change-this-admin-password"
Before starting:
- Generate
SECRET_KEYwith:python3 -c "import secrets; print(secrets.token_hex(32))" - Set
ADMIN_PASSWORDto a strong password (hashed withihatemoney generate_password_hashor set plaintext — the app hashes it on first use) - Set
ALLOW_PUBLIC_PROJECT_CREATIONtoFalseif you want only admins to create projects
Start the stack:
docker compose up -d
Initial Setup
- Open
http://your-server-ip:8000in your browser - Click “Create a project” (or “Login” if you have one)
- Enter a project name, password, and contact email
- Add members to the project
- Start logging expenses — select who paid, how much, and who benefits
Each project has its own password. Share the project URL and password with group members. No individual user accounts needed.
Configuration
| Setting | Default | What It Does |
|---|---|---|
SECRET_KEY | (none) | Flask session encryption — required |
ALLOW_PUBLIC_PROJECT_CREATION | True | Whether anyone can create projects |
ADMIN_PASSWORD | (none) | Password for the admin panel at /admin |
SQLALCHEMY_DATABASE_URI | SQLite | Database connection string |
DEFAULT_CURRENCY | XXX | Default currency for new projects (e.g., USD, EUR) |
Using PostgreSQL Instead of SQLite
For multi-user deployments, PostgreSQL is more reliable:
services:
ihatemoney:
image: ihatemoney/ihatemoney:7.0.1
container_name: ihatemoney
restart: unless-stopped
ports:
- "8000:8000"
volumes:
- ./ihatemoney.cfg:/etc/ihatemoney/ihatemoney.cfg:ro
depends_on:
postgres:
condition: service_healthy
networks:
- ihatemoney
postgres:
image: postgres:16-alpine
container_name: ihatemoney-db
restart: unless-stopped
environment:
POSTGRES_USER: ihatemoney
POSTGRES_PASSWORD: change_this_strong_password
POSTGRES_DB: ihatemoney
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ihatemoney"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ihatemoney
volumes:
postgres_data:
networks:
ihatemoney:
Update ihatemoney.cfg:
SQLALCHEMY_DATABASE_URI = "postgresql://ihatemoney:change_this_strong_password@postgres/ihatemoney"
Reverse Proxy
Example Nginx Proxy Manager configuration:
| Field | Value |
|---|---|
| Domain | split.yourdomain.com |
| Scheme | http |
| Forward Host | ihatemoney |
| Forward Port | 8000 |
| SSL | Request a new certificate |
For more options: Reverse Proxy Setup
Backup
With SQLite (default):
docker cp ihatemoney:/database/ihatemoney.db ./ihatemoney-backup-$(date +%Y%m%d).db
With PostgreSQL:
docker exec ihatemoney-db pg_dump -U ihatemoney ihatemoney > ihatemoney_backup.sql
For automated backup strategies: Backup Strategy
Troubleshooting
”Internal Server Error” on First Access
Symptom: 500 error after starting the container.
Fix: Check that ihatemoney.cfg is properly mounted and SECRET_KEY is set. View logs:
docker logs ihatemoney
Projects Not Saving
Symptom: Created projects disappear after container restart.
Fix: Ensure the /database volume is properly mapped. Without persistent storage, SQLite data is lost on restart.
Cannot Create Projects (Button Missing)
Symptom: Homepage shows login but no “Create a project” link.
Fix: Set ALLOW_PUBLIC_PROJECT_CREATION = True in ihatemoney.cfg, or create projects from the admin panel at /admin.
Resource Requirements
| Resource | Usage |
|---|---|
| RAM | ~30-50 MB |
| CPU | Very low |
| Disk | Negligible |
IHateMoney is extremely lightweight. It runs comfortably on a Raspberry Pi alongside other services.
Verdict
IHateMoney does one thing well: split expenses in groups. The project-based model (shared password, no individual accounts) makes it dead simple to set up for a trip, shared apartment, or event. It lacks budgeting, investment tracking, or bank syncing — those aren’t its job. For group expense splitting, it’s the best self-hosted option. For personal budgeting, use Actual Budget. For full financial tracking, use Firefly III.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments