Self-Hosting
Self-hosting is for teams that need a shared web entry point, private network access, dedicated database credentials, AI key management, and persistent application data.
Best-Fit Scenarios
- Run Dory in a private network, private cloud, or self-managed server.
- Manage database access, AI keys, secrets, and team permissions directly.
- Provide one shared browser entry point for a team.
- Connect private, cloud, staging, or production databases.
Recommended Architecture
| Layer | Decision |
|---|---|
| Runtime | Run Dory as a Docker container. |
| Application data | Choose persistent PGlite storage or Postgres. |
| Public access | Put Dory behind HTTPS through a reverse proxy or gateway. |
| Secrets | Store .env values through a secret-management process. |
| Database network | Confirm the Dory runtime can reach target databases. |
| Identity | Choose email login, verification, or OAuth policy. |
Two Database Concepts
| Database role | What it stores | Where to configure |
|---|---|---|
| Application database | Dory users, organizations, connections, saved queries, settings, and MCP tokens. | Environment Variables |
| Connected databases | Business or analytical databases queried through Dory. | Connect Your Database |
Do not leave application data inside a disposable container filesystem for production. PGlite needs a persistent volume; Postgres needs a dedicated backed-up database.
Preflight Checklist
| Item | Confirm |
|---|---|
| Domain | The URL users will open, such as https://dory.example.com. |
| HTTPS | Required for team deployments. |
| Auth URL | BETTER_AUTH_URL matches the browser-facing URL. |
| Secrets | DS_SECRET_KEY and BETTER_AUTH_SECRET are generated and stored safely. |
| Application database | PGlite persistent storage or Postgres is selected. |
| AI | Provider, model, API key, data boundary, and key rotation are decided. |
| Database accounts | Production connections use readonly credentials first. |
| Members | Invitation, connection ownership, and offboarding rules are defined. |
| Backups | Application data, .env, and database credentials have a backup plan. |
Recommended Rollout
- Choose the domain, HTTPS path, and network boundary.
- Choose application storage: PGlite or Postgres.
- Prepare
.envand secrets. - Start a test deployment with Docker.
- Sign in with the initial admin user.
- Configure authentication policy.
- Connect a test database and validate SQL Console, Explorer, AI, and Saved Queries.
- Back up data before adding production database connections.
Operational Boundaries
- Use dedicated database users for production connections.
- Prefer readonly credentials for production analysis.
- Allowlist the Dory server egress IP for cloud databases.
- Use SSH tunnels or private routing for internal databases.
- Mount SQLite and DuckDB files into the container when needed.
- Dory AI sends necessary context to the configured provider, so decide the allowed data boundary before rollout.
Related Docs
How is this guide?