Self-Hosting
OpenFinance is designed to be self-hosted. Your financial data stays on your server — no third-party cloud services required.Docker Deployment
The simplest way to deploy OpenFinance is with Docker Compose.Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | SQLite connection string. Use file:./data/openfinance.db for Docker. |
BETTER_AUTH_SECRET | Yes | Secret key for session encryption. Generate with openssl rand -base64 32. |
BETTER_AUTH_URL | Yes | Public URL of your instance (e.g., https://finance.yourdomain.com). |
OPENROUTER_API_KEY | Yes | OpenRouter API key for AI statement processing and chat. |
GOOGLE_CLIENT_ID | No | Google OAuth client ID for “Sign in with Google”. |
GOOGLE_CLIENT_SECRET | No | Google OAuth client secret. |
Building from Source
If you prefer to build the Docker image yourself:docker-compose.yml to use image: openfinance instead of the registry image.
Reverse Proxy (HTTPS)
In production, put OpenFinance behind a reverse proxy with HTTPS. Here is an example using Caddy:BETTER_AUTH_URL matches the public HTTPS URL.
- Caddy
- Nginx
Data & Backups
OpenFinance stores everything in a single SQLite database file. To back up your data:Production Considerations
- HTTPS is required for secure authentication cookies. Always run behind a reverse proxy with TLS in production.
- Regular backups — schedule a cron job to copy the SQLite database file.
- Resource requirements — OpenFinance is lightweight. A 1 CPU / 1 GB RAM VPS is sufficient for a single user.
- Updates — pull the latest image and restart: