server

self-host Coder: the server, its dashboard and sign-in

Self-host Coder: the server your agents and platform apps talk to, with a dashboard and sign-in. We run one as the hosted service; you can run your own.

server serve [--port <port>] [--host <host>] [--memory] [--runner <runner>] [--json] [--cwd <cwd>]

run the server

Run the Coder server on Bun: the address platforms deliver events to, the dashboard, and the worker that runs tasks. With DATABASE_URL it is a full server with sign-in and workspaces. Without one it is the dashboard for this machine's CLI: its config, agents, tasks and engine logins, on loopback only. --memory makes a throwaway test server that keeps everything in memory. Configured through the environment; every variable is in coder docs self-host.

  • --port <port> listen port (default: PORT, else the port in a localhost PUBLIC_URL, else 8787)
  • --host <host> listen address (default: HOST, else 127.0.0.1 without a database, else every interface)
  • --memory a throwaway test server: everything in memory, no sign-in, admin token only
  • --runner <runner> local, local-docker, vercel-sandbox, github-actions, or http
  • --json JSON output
  • --cwd <cwd> workspace directory; default current

Environment:

  • PUBLIC_URL the address platforms and browsers reach the server at (default http://localhost:)
  • PORT listen port, as hosts set it (default 8787)
  • HOST listen address, as --host
  • DATABASE_URL Postgres, set up with drizzle-kit push; turns on sign-in and workspaces
  • AUTH_WULAR_URL the Wular Auth issuer people sign in with (default https://auth.wular.ai)
  • SERVER_ENCRYPTION_KEY encrypts stored secrets and derives the sign-in keys; required with DATABASE_URL (openssl rand -base64 32)
  • RUNNER where tasks run: local (default), local-docker, vercel-sandbox, github-actions, http
  • MAX_TASKS, TASK_TIMEOUT, TASK_STALL, TASK_ATTEMPTS runner capacity and lifecycle limits
  • ADMIN_TOKEN local and memory servers: the dashboard and CLI key; minted and shown when unset
  • CODER_CACHE_HOME archived tasks, flows and usage (default OS cache directory/wular-coder)
  • WORK_DIR where the local runner keeps task work folders
  • SERVER_NAME what the dashboard calls this server (default Coder)
PUBLIC_URL=https://abc.ngrok.app coder server serve  # receive GitHub and Slack events through a tunnel; the tunnel serves only their webhooks and callbacks
PUBLIC_URL=https://agents.example.com DATABASE_URL=postgres://... coder server serve  # on your own host, backed by Postgres

server rotate-key [--json]

re-seal secrets with SERVER_ENCRYPTION_KEY

Re-seal stored app, installation, engine, and linked user secrets with the current key.

  • --json JSON output

Environment:

  • SERVER_ENCRYPTION_KEY the new key
  • SERVER_ENCRYPTION_KEY_PREVIOUS the old key, still accepted while rotating

server workflow

print the GitHub Actions workflow for RUNNER=github-actions

Print the workflow the github-actions runner dispatches. Save it as .github/workflows/coder-runner.yml in every repo the agent runs on, and set RUNNER=github-actions on the server.

coder server workflow > .github/workflows/coder-runner.yml  # add it to a repo

server app

the built-in agent's public apps

The built-in agent's apps, one per platform, shared by every workspace on this server.

server app create <integration> [--org <org>] [--name <name>] [--json]

create the built-in agent's public app

Open the page that creates the built-in agent's public app on a platform, once per server. Every workspace then connects it from its dashboard with one click. Run it where the server's environment is set.

  • <integration> the platform, such as github
  • --org <org> create it under this organization instead of your own account
  • --name <name> the app's name and handle (default Coder)
  • --json JSON output

Environment:

  • DATABASE_URL the server's Postgres
  • PUBLIC_URL the server's address, which goes into the app
coder server app create github --name wular-coder  # the hosted GitHub App