Self-hosting
Self-host Oatmilk
Run your own Oatmilk on your computer, a server or a cloud, with your data and AI models staying with you.
Oatmilk runs on your own hardware with everything it needs: the web app and its AI agents, PostgreSQL, file storage, Redis, scheduled jobs, sign-in, the REST API, MCP for AI apps and the command line. Set up for it, nothing leaves the machine: accounts, books, statements, receipts and documents stay in your database and on your disk, and AI models can run on your own hardware too.
One command asks a few questions, writes the settings, builds Oatmilk and starts it:
bun run self-host setupChoose a guide
| You want | Follow | Time |
|---|---|---|
| Oatmilk on your own computer, just for you | Run it on your computer | 20 minutes |
| Every AI model on your own hardware | Use local AI models | 15 minutes |
| Nothing at all leaving the machine | Go completely off-grid | 30 minutes |
| A server for your team at your own domain | Run it on a server | 30 minutes |
| Amazon Web Services with RDS, ElastiCache and S3 | Deploy on AWS | 1 hour |
| Google Cloud with Cloud SQL, Memorystore and Cloud Storage | Deploy on Google Cloud | 1 hour |
| Microsoft Azure with its managed PostgreSQL and Redis | Deploy on Azure | 1 hour |
| Your own PostgreSQL, Redis or S3-compatible storage (Neon, Upstash, Cloudflare R2, MinIO…) | Bring your own services | 20 minutes |
| A machine without Docker | Run it without Docker | 1 hour |
| To change Oatmilk's code | Develop Oatmilk locally | 15 minutes |
Then manage sign-in and accounts, and update, back up and troubleshoot your installation.
What runs where
Everything runs in Docker Compose, from the self-host/ folder of Oatmilk's source.
| Piece | What it is | Stays on your machine? |
|---|---|---|
| Web app and agents | One container, app, with the web app, every AI agent and the five-minute jobs | Yes |
| Database | PostgreSQL 17, bundled, or your own PostgreSQL 15 or newer | Yes |
| Database API | PostgREST, the same piece Supabase runs. Never published. | Yes |
| File storage | Supabase Storage, on a Docker volume or in an S3-compatible bucket | Yes, on the disk or MinIO |
| Redis | Caches, rate limits and locks. Bundled, or your own. | Yes |
| Sign-in | Accounts in your database with Better Auth, or Clerk | Yes, with Better Auth |
| HTTPS | Caddy: its own certificate for *.localhost, Let's Encrypt for a real domain | Yes, on *.localhost |
| AI models | Ollama, LM Studio or any OpenAI-compatible server, or Vercel AI Gateway | Yes, with local models |
| Off, or Resend for invoices, invitations and reminders | Off | |
| Bank, payment and data connections | Wise, Stripe, Notion, Google Drive, Microsoft: each optional, set up per company | Only when you connect them |
What you need
- Oatmilk's source code, cloned with Git.
- Docker Desktop, or Docker Engine with Compose 2.20 or newer. Check with
docker compose version. - Bun 1.3 or newer, which runs the setup commands.
- About 4 GB of memory and 15 GB of disk for Oatmilk itself. Local AI models need more: see Use local AI models.
- The internet, once, to build the image. After that, Oatmilk can run without it.
Use your Oatmilk like the hosted one
A self-hosted Oatmilk has the same app, REST API, webhooks and MCP server. These docs are part of it too: open /docs on your own address, and every example uses that address.
- API keys come from Developers › API keys:
oat_test_…on an install for one computer,oat_live_…on a server. - AI apps connect to
https://<your address>/api/mcpand sign in through your Oatmilk's own accounts. - The CLI signs in with
oatmilk login --host https://<your address>. See Sign in and choose a company.