Self-hosting
DodoRouter is a standard Phoenix 1.8 application backed by PostgreSQL. Source: github.com/foxwise-ai/dodorouter. License terms are covered in License below — in short, free to self-host and modify, but you can't resell it as your own competing hosted service.
Prerequisites
- Elixir 1.18 or later in the 1.x series with a matching Erlang/OTP. The project's CI uses Elixir 1.18 and OTP 27.
- PostgreSQL (CI uses 16).
- mkcert for the local development HTTPS listener.
- An Infisical project (free tier is fine) — see the callout below, this is currently required, not optional
⚠ Infisical is currently required
Every provider API key you add (OpenAI, Anthropic, z.ai, …) is stored via Infisical, a secrets manager — there is currently no local/plaintext fallback in the code. Without INFISICAL_TOKEN and INFISICAL_PROJECT_ID set, the app boots fine and the dashboard loads, but clicking Add Key on the Providers page will fail with "Failed to store API key securely" — so you won't be able to configure any provider, and no requests will succeed. Sign up at Infisical, create a project, create a Machine Identity with a Universal Auth client, and use that identity's access token as INFISICAL_TOKEN.
1. Clone and install
git clone https://github.com/foxwise-ai/dodorouter.git
cd dodorouter
mix deps.get
2. Configure environment variables
For local development, export these before starting the server (e.g. in .envrc with direnv, or a .env you source):
# Database — defaults match config/dev.exs; override if yours differs
export DB_USERNAME=postgres
export DB_PASSWORD=postgres
export DB_HOSTNAME=localhost
export DB_PORT=5432
export DB_NAME=dodo_router_dev
# Infisical — required, see callout above
export INFISICAL_TOKEN="<your machine identity access token>"
export INFISICAL_PROJECT_ID="<your infisical project id>"
export INFISICAL_ENVIRONMENT=dev # optional, defaults to "prod"
3. Set up the database, assets and local certificate
mix setup creates and migrates the database and builds the browser assets. On your development machine, generate the locally trusted certificate used by the HTTPS listener on port 4443. The certificate task installs mkcert's local CA and writes the key and certificate into priv/cert.
mix setup
mix attesto_phoenix.gen.dev_https
4. Start the server
mix phx.server
Visit http://localhost:4000. Register an account, confirm via the magic-link email — in dev, DodoRouter uses Swoosh's local mailbox instead of sending real email, so open http://localhost:4000/dev/mailbox to read it. From there, follow the same steps as the Quickstart.
Call GET /health to check the database connection. A healthy instance returns 200 with {"status":"ok"}. Call GET /api/version to identify the version running on that instance.
Production environment variables
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL |
Yes | e.g. ecto://user:pass@host/dodo_router_prod |
SECRET_KEY_BASE |
Yes | Generate with mix phx.gen.secret |
PHX_HOST |
Yes | Your public domain |
PHX_SERVER |
Yes | Set to true to actually start the endpoint under a release |
PORT |
No | Defaults to 4000 |
INFISICAL_TOKEN |
Yes* | *Required for provider-key storage to work at all (see callout above) |
INFISICAL_PROJECT_ID |
Yes* | Paired with the token above |
INFISICAL_ENVIRONMENT |
No | Defaults to prod |
RESEND_API_KEY |
No | Transactional email (magic links). Without it in prod, mail simply won't send |
EMAIL_FROM |
No | Defaults to noreply@dodorouter.com |
STRIPE_SECRET_KEY |
No | Only set this if you want the $19/mo billing paywall enabled. Unset = billing disabled, everyone has full access |
STRIPE_WEBHOOK_SECRET |
No | Required only alongside STRIPE_SECRET_KEY |
ECTO_IPV6 |
No | Set to true to enable IPv6 for the DB socket |
POOL_SIZE |
No | Ecto pool size, defaults to 10 |
ATTESTO_ISSUER |
No | OAuth issuer URL for the agent surface. Defaults to https:// + PHX_HOST. Read at boot, so changing it just needs a restart |
ATTESTO_AUDIENCE |
No | OAuth resource identifier. Defaults to <issuer>/mcp |
ATTESTO_TRUSTED_PROXIES |
No | Comma-separated IPs/CIDRs of TLS-terminating proxies whose X-Forwarded-Proto the OAuth endpoints believe. Defaults to loopback, which covers a reverse proxy on the same machine; set it when the proxy reaches the app across a network |
ATTESTO_SIGNING_KEY_PATH |
For the agent surface | Absolute path to the EC P-256 PEM that signs OAuth access tokens: openssl ecparam -name prime256v1 -genkey -noout -out oauth_signing_key.pem && chmod 600 oauth_signing_key.pem. Without it, the whole OAuth flow works up to the final token exchange, which then fails — consent screens render, tokens never mint. (ATTESTO_SIGNING_KEY_PEM also works for environments that can pass a multi-line value inline; systemd's EnvironmentFile cannot) |
For deploy specifics (hot code upgrades, systemd, Castle release management), see the project's own AGENTS.md in the repo — those are maintainer-facing operational details rather than user-facing setup, so we won't duplicate them here. See also Deployment for a minimal production boot sequence.
If you use the repository's GitHub Actions deployment workflows, follow GitHub Actions and Tailscale for the supported action version, OAuth setup, and release deployment steps.
License
DodoRouter is source-available under the O'Saasy License. In short: you're free to use, modify, self-host, and even sell copies of it — the one thing you can't do is turn around and offer it as a competing hosted/managed service where the software itself is the product. See the full license text in the repository for the exact terms.