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

RequirementUsed forLocal runProduction
Node.js and pnpm 10.33Installing and running the workspaceYesYes
DockerRunning Postgres (and Valkey) in containersYesNo
Cloudflare accountWorkers, R2 buckets, Queues, Hyperdrive, and custom hostnamesOptionalYes
PlanetScale PostgresProduction database, reached through Cloudflare HyperdriveNoYes
AWS accountThe API origin on ECS, its secrets in SSM, and the deploy roleNoYes
TerraformCreating the AWS stack from the production Terraform rootNoYes
GitHub account and an ops repoRunning deploy workflows and holding production variablesNoYes
Google and GitHub OAuth appsSign-in for the dashboardYesYes

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.

1

Install the dependencies

From the root of our checkout, install the workspace packages.

bash
pnpm install
2

Start Postgres in Docker

This starts the postgres service from the repository's docker-compose.yml. It listens on 127.0.0.1:5432.

bash
pnpm db:local:up
3

Apply the database migrations

The local connection string is postgresql://doxa:doxa@localhost:5432/doxa. The migration command uses it automatically.

bash
pnpm db:local:migrate
4

Start 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:

  1. Fill the ops repo templates and the Cloudflare ID file.

  2. Create the AWS stack with Terraform, after the first image is pushed.

  3. Write the API secrets to SSM before the first deploy.

  4. Apply the Cloudflare IDs in the deploy checkout.

  5. Validate the production config.

  6. 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:

SettingWhat it controls
BETTER_AUTH_URLThe public address of the API, for sign-in
WEB_ORIGINThe dashboard address
MCP_RESOURCE_URLThe address agents use to reach the MCP server
DOCS_BASE_DOMAINThe domain where project sites are served, such as doxa.page
DOCS_CUSTOM_DOMAIN_CNAME_TARGETThe target that custom domains point to
ADMIN_EMAILSAccounts with administrator access
DOXABOT_ENABLEDWhether Doxabot generation is turned on

The template also sets DEV_ADMIN_ENABLED to false. We keep it that way in production.

Next steps