Team and Hosting
Self-hosting
Run Doxa on your computer with Docker Postgres, or deploy it to Cloudflare and AWS
What self-hosting covers
Doxa is open source under the Apache 2.0 license, so we can run the platform ourselves instead of using the hosted product at doxa.so. There are two paths:
Run locally to try the dashboard, the API, and generated docs sites on our own computer, with Postgres in Docker.
Deploy to production on Cloudflare Workers, with the API origin running on AWS.
We keep our production settings in a private ops repository. The public code stays the same, and we deploy one commit of it from our own checkout.
Prerequisites
| Requirement | Used for | Local run | Production |
|---|---|---|---|
| Node.js and pnpm 10.33 | Installing and running the workspace | Yes | Yes |
| Docker | Running Postgres (and Valkey) in containers | Yes | No |
| Cloudflare account | Workers, R2 buckets, Queues, Hyperdrive, and custom hostnames | Optional | Yes |
| PlanetScale Postgres | Production database, reached through Cloudflare Hyperdrive | No | Yes |
| AWS account | The API origin on ECS, its secrets in SSM, and the deploy role | No | Yes |
| Terraform | Creating the AWS stack from the production Terraform root | No | Yes |
| GitHub account and an ops repo | Running deploy workflows and holding production variables | No | Yes |
| Google and GitHub OAuth apps | Sign-in for the dashboard | Yes | Yes |
Local runs use real Better Auth sessions by default, so we need OAuth credentials even on our computer.
Run the platform locally or deploy to production
Pick the tab that matches our goal. The local path needs only Docker and pnpm. The production path needs the Cloudflare, AWS, and ops repo setup from the table above.
Install the dependencies
From the root of our checkout, install the workspace packages.
pnpm installStart Postgres in Docker
This starts the postgres service from the repository's docker-compose.yml. It listens on 127.0.0.1:5432.
pnpm db:local:upApply the database migrations
The local connection string is postgresql://doxa:doxa@localhost:5432/doxa. The migration command uses it automatically.
pnpm db:local:migrateStart the platform services
Once Postgres is running and migrated, we start the API, the web app, and the docs runtime with the local start command. The start command prints the dashboard address and logs for each service.
When the stack is up, we open the dashboard at the address the start command prints. A generated site opens at http://<project-slug>.localhost:3002, where <project-slug> is the slug of a project we created.
Order of the production deploy
We follow this order each time we deploy:
Fill the ops repo templates and the Cloudflare ID file.
Create the AWS stack with Terraform, after the first image is pushed.
Write the API secrets to SSM before the first deploy.
Apply the Cloudflare IDs in the deploy checkout.
Validate the production config.
Deploy the API origin on ECS, then the edge Worker, and the other production services.
Note:
Run apply-production-ids.mjs only in a fresh deploy checkout. It rewrites the Wrangler configs in place, so running it in a working tree can leave real IDs in files that we commit.
Production settings to review
Some values in the variables template shape how the public site and the dashboard behave. We check them before the first deploy:
| Setting | What it controls |
|---|---|
BETTER_AUTH_URL | The public address of the API, for sign-in |
WEB_ORIGIN | The dashboard address |
MCP_RESOURCE_URL | The address agents use to reach the MCP server |
DOCS_BASE_DOMAIN | The domain where project sites are served, such as doxa.page |
DOCS_CUSTOM_DOMAIN_CNAME_TARGET | The target that custom domains point to |
ADMIN_EMAILS | Accounts with administrator access |
DOXABOT_ENABLED | Whether Doxabot generation is turned on |
The template also sets DEV_ADMIN_ENABLED to false. We keep it that way in production.