Manual Install (Node + Postgres)
CompassDocs is a standard Next.js server plus a PostgreSQL database, so you can run it directly with Node.js — handy for local development or a hand-managed server.
Prerequisites
Section titled “Prerequisites”- Node.js 20+
- A PostgreSQL 14+ database
1. Get a PostgreSQL database
Section titled “1. Get a PostgreSQL database”Homebrew (macOS, no Docker):
brew install postgresql@16 && brew services start postgresql@16createdb compassdocsDocker (just the database):
docker run -d --name compass-pg -p 5432:5432 \ -e POSTGRES_PASSWORD=compass -e POSTGRES_DB=compassdocs \ postgres:162. Configure and run
Section titled “2. Configure and run”git clone https://github.com/mattny20/CompassDocs.gitcd CompassDocsnpm installcp .env.example .env # set DATABASE_URL to the value from abovenpm run dev# open http://localhost:3000On first connection the app creates its own schema and seeds example spaces
and documents — no manual migrations. Open the app and the setup wizard
creates your admin account (there is no default password). From 1.20.27 it
asks for the setup token the server prints in its output when it starts;
or set
COMPASSDOCS_ADMIN_USER and COMPASSDOCS_ADMIN_PASSWORD in .env to have
the admin created on first launch instead, then sign in with those. See
First-run setup.
3. Production build
Section titled “3. Production build”npm run buildnpm run startThe server listens on port 3000 by default (web UI and the /api/* REST
routes share the same port — there is no separate API port). To use a different
one: PORT=8080 npm run start. Remember to allow the port through your firewall
for remote access — see Ports & firewall.
Connecting to managed Postgres
Section titled “Connecting to managed Postgres”For hosted databases (Neon, Supabase, RDS, …), TLS is usually required.
CompassDocs enables SSL automatically for non-local hosts. If you hit
The server does not support SSL connections, your database is local — set
DATABASE_SSL=disable (or add ?sslmode=disable to the URL). To force SSL on a
host that looks local, set DATABASE_SSL=require. See
Environment variables.
Live desk updates and connection poolers
Section titled “Live desk updates and connection poolers”From 1.20.19 the helpdesk’s queue updates live. Each server process keeps
one extra database connection that listens for ticket changes, and
checks it every 45 seconds; if it stops working, the desk falls back to
refreshing every 30 seconds and the log says why
(helpdesk.live_unavailable).
- Connection poolers. A pooler in transaction mode, such as
pgbouncer’s default, accepts the listening connection but never
delivers the changes. Set
DATABASE_LISTEN_URLto a direct or session-mode connection string for the same database to get live updates; everything else keeps usingDATABASE_URL. - Reverse proxies must not buffer
/api/helpdesk/live(the app asks nginx-style proxies not to) and should allow idle connections of more than 25 seconds. - After a deploy every open desk tab reloads its list once, spread out over a few seconds.
Deploying to a platform
Section titled “Deploying to a platform”Because the app is stateless, it runs anywhere and scales horizontally. Set
DATABASE_URL (and optionally ANTHROPIC_API_KEY, COMPASSDOCS_ADMIN_*) as
environment variables on your platform of choice:
| Target | Notes |
|---|---|
| Vercel + Neon | Import the repo; add a Neon/Vercel Postgres and set DATABASE_URL. Cheapest to start. |
| Railway | App + Postgres plugin in one project; Railway injects DATABASE_URL. |
| Render | Web Service + managed Postgres; wire the internal DATABASE_URL. |
| Fly.io / a VPS | Use the included Dockerfile (Next.js standalone output). |
Use a pooled connection string on serverless platforms and keep
DATABASE_POOL_MAX modest.
