canonry

Deployment Guide

Canonry runs as a self-hosted server. This guide covers common deployment patterns.

Tenancy model (read this first)

Canonry is single-tenant. Each deployment serves one operator or team.

For unrelated teams, deploy a separate instance, database, and OAuth client for each team. See Deployment Posture for the trust boundary.

Trusted reverse proxies

Set CANONRY_TRUST_PROXY to a comma-separated list of trusted proxy addresses or CIDRs (for example, 127.0.0.1,::1 for a local reverse proxy). Numeric hop counts are rejected because they cannot authenticate the immediate proxy peer. Use true only when network access guarantees that every connection comes through a trusted proxy. The standalone server defaults to false; Cloud Run requires an explicit setting.

Standalone Cloud Run API

The apps/api entry point mounts the shared REST routes. Set DATABASE_URL to a writable SQLite file path, such as /data/canonry/data.db. The API opens that path as a local file. Use canonry serve to run the full engine, including scheduled jobs and the dashboard.

Local (default)

canonry bootstrap
canonry serve

Opens at http://127.0.0.1:4100. No provider credential is needed for Agent Readiness.

Local state defaults to ~/.canonry/config.yaml and ~/.canonry/data.db. Set CANONRY_CONFIG_DIR=/private/path consistently for canonry bootstrap, the server, and all CLI/MCP clients to isolate an install in another directory. Provider credentials are optional for bootstrap and Agent Readiness.

Use 127.0.0.1, not localhost. canonry serve binds the IPv4 loopback 127.0.0.1 (override with CANONRY_HOST). On machines where localhost resolves to the IPv6 loopback ::1 first, http://localhost:4100 returns connection refused even though the server is up — browse to http://127.0.0.1:4100 instead, or set CANONRY_HOST=::1 to bind IPv6.

First-run dashboard password

The first time you open the dashboard, it asks you to create a dashboard password. Every password sign-in uses the install’s root API key (apiKey in config.yaml), so setting the password gives full access to every project.

Create the password before you forward the port. Without the root API key, Canonry accepts the setup from any process that can connect to its loopback port. A TCP forwarder on the same machine (ssh -R, socat, kubectl port-forward, tailscale serve --tcp, ngrok tcp) adds no header, so Canonry cannot tell its remote clients from local ones. Create the password before you start the forwarder.

To find the root API key, read apiKey in the config file:

grep '^apiKey:' "${CANONRY_CONFIG_DIR:-$HOME/.canonry}/config.yaml"

The same rule applies to POST /api/v1/session/setup with Authorization: Bearer <root API key>. Without the key, the request gets 401 AUTH_REQUIRED and Canonry writes nothing. If the root API key in config.yaml was revoked or deleted, a request with that key gets 401 AUTH_INVALID, which tells you to run canonry bootstrap.

If you forget the dashboard password, sign in with the root API key (Forgot password? Use API key on the sign-in screen), or reset the password on the machine that holds config.yaml:

canonry dashboard reset-password

The command removes the password from config.yaml and does not call the server. Restart Canonry afterward: a running server keeps the old password until it restarts. The dashboard then asks for a new password under the rules above, so stop any port forwarder first and create the password right away. If the server uses another config directory, set CANONRY_CONFIG_DIR to it before you run the command. Installs with named accounts do not use this password: remove and recreate the account with canonry user delete <name> and canonry user create.

Dashboard sessions persist in the database and survive server restarts. Shared-password and API-key logins expire twelve hours after sign-in; logout and key revocation still end access. Rotating an API key ends its browser sessions, even when bootstrap retains the key’s ID. Changing the dashboard password hash and restarting ends password-derived sessions; API-key sign-ins are independent of that password. Restoring previous credentials does not revive ended sessions. Named-account sessions renew during use, up to thirty days. Cookies are HttpOnly, so page JavaScript cannot read them; inspect them in the browser’s cookie storage. Sessions created before durable storage was introduced need one new sign-in after upgrading. Upgrading sessions without credential bindings also requires a new sign-in.

Only disable the dashboard password behind upstream auth. dashboard: { requirePassword: false } (or CANONRY_DASHBOARD_REQUIRE_PASSWORD=0) skips Canonry’s browser password gate while leaving API bearer-key auth intact. Set it false only when an upstream layer enforces auth, such as the Canonry Embed proxy. Never expose an engine with requirePassword: false directly to the internet.

Set any of these options to false to hide the corresponding dashboard controls.

dashboard:
  showFeedback: false
  showResourceLinks: false
  showUpdateNotification: false

canonry serve --hide-feedback and canonry start --hide-feedback hide the Feedback button in the top bar and the Feedback section in Settings. For a persistent setting, use dashboard.showFeedback: false in YAML or CANONRY_DASHBOARD_SHOW_FEEDBACK=0 in the environment and restart the server. The command-line flag takes precedence over the environment, which overrides YAML.

The self-hosted navigation footer links to GitHub, Discord, X, and YouTube. Managed instances (CANONRY_RUNTIME_MODE=cloud) and the public demo show only GitHub. Embedded views omit the footer. Set the runtime mode when provisioning the managed engine.

showResourceLinks: false hides the footer links, repository guides on Agent Setup, and release highlights that invite users to an external community.

Self-hosted dashboards show available updates in the top bar. The version badge opens the release page. After installation, users can open What’s new to read highlights. An unread dot marks authored minor and major releases. Opening the panel clears the dot across tabs for that dashboard and account. Users can reopen it to read the notes again. A patch update keeps existing notes available and does not add an unread dot.

The first visit features the latest applicable note at or below the running version. Returning users who skipped releases can read their missed highlights together. The server includes its installed version in the dashboard document, so an open tab keeps the notes for the build it loaded.

Live health views refresh service status every 15 seconds while visible. Elsewhere, a stale status used by the dashboard refreshes when you return to the tab. Release notes use the build in the document and make no network request.

Managed Canonry engine dashboards run in What’s new only mode. Customers see product highlights after an administrator rolls out a release. Releases without applicable highlights are quiet. This mode hides version numbers in the navigation, available-version prompts, and package or source links in the panel. A release can invite customers to the Canonry Discord. Set dashboard.showResourceLinks: false to hide that invitation. Public demos and embedded views omit release notices.

To use the same presentation on a standalone dashboard, set dashboard.whatsNewOnly: true in the YAML config or CANONRY_DASHBOARD_WHATS_NEW_ONLY=1 in the container environment. The environment takes precedence over YAML on standalone instances. CANONRY_RUNTIME_MODE=cloud selects this mode automatically.

showUpdateNotification: false hides the available-update badge and What’s new on both self-hosted and managed engine dashboards. Update checks and CLI notices stay active.

For container deployments, set CANONRY_DASHBOARD_SHOW_RESOURCE_LINKS=0 or CANONRY_DASHBOARD_SHOW_UPDATE_NOTIFICATION=0.

Agent setup instructions

Agent Setup includes local plugins, CLI, and canonry-mcp instructions by default. For a client deployment whose users connect through ChatGPT or Claude, hide those instructions explicitly:

dashboard:
  showLocalAgentSetup: false

For containers, set CANONRY_DASHBOARD_SHOW_LOCAL_AGENT_SETUP=0 and restart. The environment value overrides YAML; 1 restores local instructions. Blank or unrecognized environment values fall back to YAML, then the default true.

This setting changes only Agent Setup presentation. CLI, API, MCP, permissions, and hosted connector readiness stay the same. Whether local instructions appear depends only on this setting, not on public URL, readiness, or user role. With them on, a dashboard opened on the computer running Canonry (localhost) leads with the agent setup request and plugin commands until hosted setup is ready; any other dashboard leads with hosted setup and keeps local instructions collapsed. Both views include hosted connection steps when configured; the client view never falls back to local commands if hosted setup needs attention. showResourceLinks: false hides repository documentation links while retaining the ChatGPT and Claude help links.

Brand mark

The dashboard shows the Canonry mascot in the browser tab, the sidebar, and its sign-in screen. For a client deployment, show the Canonry icon instead: the canary on a white tile, as in the plugin listings and on the OAuth sign-in pages.

dashboard:
  brandMark: icon

For containers, set CANONRY_DASHBOARD_BRAND_MARK=icon and restart. The environment value overrides YAML; mascot restores the default. Blank or unrecognized values fall back to YAML, then mascot. This changes presentation only.

Managed run kinds

Use dashboard.managedRunKinds for a deployment where your team runs work for clients:

dashboard:
  managedRunKinds:
    - answer-visibility
    - site-audit

For containers, set CANONRY_DASHBOARD_MANAGED_RUN_KINDS=answer-visibility,site-audit and restart. Values must belong to schedulableRunKindSchema; an unknown kind refuses boot with the setting name. The list is deduplicated. Other schedulable kinds are accepted for configuration, but this release changes only sweep and scan UI.

Resolution order is the new environment list, the legacy environment boolean, the new YAML list, then the legacy YAML boolean. Blank environment values fall through. An empty YAML list disables management. Within each source, the new list replaces the legacy setting; it does not add to it. CANONRY_DASHBOARD_MANAGED_SWEEPS=1 and dashboard.managedSweeps: true remain compatible aliases for ['answer-visibility'] only. The legacy environment value 0 still disables management unless the new environment list is set.

Simple and Advanced Measurement dashboards use the same presentation policy:

Managed status reads the corresponding schedule’s actual nextRunAt. Agent Readiness shows “Next scan Thursday 1 Oct, 06:00 UTC · managed by your Canonry team” when that is the enabled schedule’s time. Without a usable schedule time, it shows “Scans are run by your Canonry team”, with no invented date. The sweep status shows the next date in the schedule’s own timezone, such as “Next sweep: Sep 23”. It shows “Sweep running…” during a run and “Next sweep unavailable” when there is no usable time. Pages that would otherwise offer a sweep say “Sweeps are run by your Canonry team”. Queued/running states, scores, factor scorecards, page lists, maps, failure and partial-scan explanations, and dead-link results remain available.

The admin-only project-creation scan in OnboardingSetupPage is outside this client presentation policy. Discovery and Research runs retain their existing access rules and use provider quota separately from scheduled visibility sweeps.

These settings are presentation only, with one exception: Aero. CLI, API, MCP, scheduling, and server authorization are unchanged. Viewer sessions and read-only keys cannot start scans or sweeps regardless of these settings. With neither setting, the injected client config is byte-identical; managedRunKinds is injected only when non-empty.

When answer-visibility is managed, Aero does not get the tools that start or fill a run, write or delete a schedule, or apply a project config (an applied spec replaces the schedule). Its cancel tool refuses answer-visibility sweeps but still stops the Agent Readiness audit scans and syncs Aero can start. This holds in every tool scope, so a write-scope Aero turn from the API or canonry agent ask cannot start a sweep either. Aero can still read runs and schedules. The operator’s own canonry run and canonry schedule commands are unaffected.

Aero reasoning

Aero asks the model to reason a little before it answers and calls tools. OpenAI models default to low; Claude, Gemini and Z.ai default to off. A model used through OpenRouter gets the same default as its own provider, so openai/gpt-6-luna runs at low. To set it for the install:

agent:
  reasoning: low

Levels are off, minimal, low, medium, high, xhigh and max. A model that does not support a level uses the nearest one it does. CANONRY_AGENT_REASONING overrides it for container deployments. Higher levels take longer and cost more per answer; on Canonry’s analyst eval, GPT-6 Luna at low was both faster and more accurate than at off or medium.

Viewer Aero

By default only administrators can use Aero. To let signed-in viewer accounts use it too:

agent:
  allowViewers: true

CANONRY_AGENT_ALLOW_VIEWERS=1 overrides it for container deployments.

A viewer gets their own Aero conversation, kept in server memory and cleared on restart. They never see an administrator’s conversations, history or Aero memory notes, and an administrator’s conversation never receives a viewer’s turns. Each turn runs on a short-lived read-only key delegated to the viewer, so every tool call has exactly the viewer’s own access, and the key is revoked when the turn ends. Viewers get read tools only, without live ads or Google Marketing reads, and cannot pick the model. On a managed install they cannot start or schedule sweeps either. Each viewer can run 50 turns per project per UTC day; every turn uses the install’s configured Aero model and its budget. API keys are unaffected: a narrow key is still refused on every Aero route.

Viewer research

An operator can let signed-in viewer accounts run isolated research queries:

research:
  allowViewers: true
  viewerDailyRunLimit: 20

CANONRY_RESEARCH_ALLOW_VIEWERS and CANONRY_RESEARCH_VIEWER_DAILY_RUN_LIMIT override these values for container deployments. The opt-in defaults to false; the daily per-project cap defaults to 20 and resets at 00:00 UTC.

This grant covers only POST /projects/:name/research/runs. It does not grant access to provider settings, tracked-query changes, discovery, or visibility sweeps. Administrators and wildcard API keys keep their existing access. Explicit research.run API keys can run research independently of the viewer opt-in; read alone and unrelated scopes cannot. Viewer OAuth clients must explicitly obtain research.run consent, bounded by this deployment opt-in. Existing read-only OAuth grants do not acquire research permission automatically.

The daily cap is shared by all limited research callers for a project across browser sessions, API, CLI, and MCP. Reconnecting or using another key does not reset it; replaying an identical idempotent request does not consume another batch. The configuration names remain unchanged for compatibility. Each new run records the initiating account or API key and whether it consumed the limited budget. MCP retains the original account, not an ephemeral session identity. See MCP research access for setup.

Embed fonts

Canonry ignores the font key in embed.theme and X-Canonry-Embed-Theme. All dashboards use the bundled Geist fonts. They do not load Google Fonts or fonts from the host page. The mode, bg, fg, and accent theme keys remain available.

Embedded query editing

An embedded dashboard is read-only, with one exception. When the fronting proxy lets a dashboard’s clients manage their own queries, the dashboard can add and remove that project’s tracked queries.

Two things turn this on:

A key with embed.queries.write can call only POST /projects/:name/query-tracking/preview and POST /projects/:name/query-tracking/commit. Every write it sends must carry the limit header. Canonry then applies these rules:

A caller that holds * or measurement-plan.write keeps full authority on these routes, and the embed rules do not apply to it.


Behind a Reverse Proxy

You can serve canonry behind any reverse proxy — nginx, Caddy, Traefik, etc. — at either the root path or a sub-path.

Canonry checks the HTTP Host header to prevent DNS rebinding. It accepts localhost, valid IPv4/IPv6 addresses, the configured bind hostname, and the hostnames in apiUrl and publicUrl. Other DNS names receive HTTP 403.

If the proxy hostname is absent from apiUrl, set publicUrl in ~/.canonry/config.yaml:

publicUrl: https://example.com

Use the external URL’s actual scheme and hostname. Restart Canonry after this change. Configure the proxy to forward the external Host header.

For a sub-path, include the prefix in publicUrl, for example https://example.com/canonry/, and set basePath: /canonry/.

First-run password through a proxy. The proxy connects to Canonry over loopback, but the visitor is remote. Enter the root API key in the setup form (see First-run dashboard password). You can also create the password on the server itself before you set publicUrl and open the proxy.

Canonry refuses a first-run password setup without the root API key in these cases:

The client sets Host, and nginx’s $host is the value that the client sent. Thus Host cannot show that a request is local. The forwarding headers mark a request as proxied, so configure the proxy to send X-Forwarded-For, as the examples below do.

A proxy without forwarding headers leaves setup open. Some proxies send HTTP/1.1 and no forwarding header, for example nginx with proxy_http_version 1.1; and no X-Forwarded-For, or HAProxy without option forwardfor. Through such a proxy, a visitor who sends Host: localhost looks local to Canonry. If neither publicUrl nor a base path is set, that visitor can create the password without the root API key. Create the password before you open the proxy, or configure the proxy to send X-Forwarded-For.

Root path (/)

Proxy all traffic on a domain directly to canonry’s port:

Caddy:

example.com {
    reverse_proxy localhost:4100
}

nginx:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:4100;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Sub-path (/canonry/, /tools/canonry/, etc.)

When canonry shares a domain with other services, serve it under a prefix. Use --base-path to tell canonry where it lives:

canonry serve --base-path /canonry/

Or set it in your config (~/.canonry/config.yaml):

basePath: /canonry/

Canonry will automatically:

Caddy:

example.com {
    # Canonry API — must be routed before the UI prefix rule
    handle /api/v1* {
        reverse_proxy localhost:4100
    }

    # Canonry UI — strip prefix before proxying
    handle /canonry* {
        uri strip_prefix /canonry
        reverse_proxy localhost:4100
    }

    # Other services
    handle {
        reverse_proxy localhost:3000
    }
}

nginx:

server {
    listen 80;
    server_name example.com;

    # Canonry API
    location /api/v1/ {
        proxy_pass http://localhost:4100;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Canonry UI
    location /canonry/ {
        proxy_pass http://localhost:4100/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Note: The /api/v1 rule must come before the catch-all. Canonry’s API calls use absolute paths (/api/v1/...) — they need to reach port 4100 regardless of the UI prefix.


Daemon mode

Run canonry as a background process that survives terminal exits:

canonry start                          # Start in background
canonry start --base-path /canonry/   # With sub-path
canonry stop                           # Stop daemon

Environment variables

All CLI flags have environment variable equivalents:

Flag Env var Default
--port CANONRY_PORT 4100
--host CANONRY_HOST 127.0.0.1
--base-path CANONRY_BASE_PATH (none)

Example with env vars (useful for systemd units, Docker, etc.):

CANONRY_PORT=4100 CANONRY_BASE_PATH=/canonry/ canonry serve

Deployment identity is env-only and is reported by GET /health: CANONRY_INSTANCE names the instance, CANONRY_INSTANCE_ROLE tags what it is for (convention: internal, client-demo, client-trial, preview), and CANONRY_COMMIT supplies the build commit when the bundle was built without git. See “Health endpoint” in AGENTS.md for the response shape.

CANONRY_INSTANCE=acme-demo CANONRY_INSTANCE_ROLE=client-demo canonry serve

Tailscale

To share canonry over a Tailscale network with HTTPS:

Set publicUrl to your Tailscale HTTPS URL in ~/.canonry/config.yaml:

publicUrl: https://your-node.your-tailnet.ts.net

Restart Canonry after this change.

# Expose port 4100 via Tailscale Serve (HTTPS on :443)
tailscale serve --bg http://localhost:4100

# Access at https://<hostname>.tail…ts.net

Because publicUrl names the tailnet host, the first-run password setup asks for the root API key, also on this machine (see First-run dashboard password).

For sub-path via Caddy + Tailscale, configure Tailscale Serve to point at Caddy’s port (80) and use the Caddy sub-path config above.


Systemd unit (Linux)

Create /etc/systemd/system/canonry.service:

[Unit]
Description=Canonry — agent-first AEO operating platform
After=network.target

[Service]
Type=simple
User=youruser
ExecStart=/usr/local/bin/canonry serve --port 4100 --base-path /canonry/
Restart=on-failure
RestartSec=5
Environment=CANONRY_CONFIG_DIR=/home/youruser/.canonry

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now canonry

Docker

Repository image

The repository image runs canonry bootstrap at startup. Its configuration and SQLite data live in /data/canonry by default.

docker build -t canonry .
docker run -d --name canonry \
  -p 4100:4100 \
  -v canonry-data:/data/canonry \
  canonry

Custom image from npm

Save this example as Dockerfile.npm. It uses the root user’s default configuration directory, /root/.canonry.

FROM node:26.12.1-bookworm-slim@sha256:1e96b01216cab31612cd1f9480e83413472dee8686d423cb4c1ec62bf8a26e9e
RUN npm install -g @canonry/canonry
# Tells update notices to upgrade by rebuilding this image.
ENV CANONRY_INSTALL_METHOD=docker
EXPOSE 4100
CMD ["sh", "-c", "canonry bootstrap && exec canonry serve --host 0.0.0.0"]
docker build -f Dockerfile.npm -t canonry-npm .
docker run -d --name canonry-npm \
  -p 4100:4100 \
  -v canonry-npm-data:/root/.canonry \
  canonry-npm

Open the dashboard

Open http://127.0.0.1:4100 from the Docker host. For a DNS name, configure publicUrl as described in Behind a Reverse Proxy. If you serve Canonry under /canonry/, add -e CANONRY_BASE_PATH=/canonry/ to docker run. Open the dashboard at http://127.0.0.1:4100/canonry/.

Both examples bind to 0.0.0.0. First-run password setup requires the root API key. Read apiKey from the running container. For the custom image, replace canonry with canonry-npm in the command.

docker exec canonry sh -c 'grep "^apiKey:" "${CANONRY_CONFIG_DIR:-$HOME/.canonry}/config.yaml"'

How sub-path works (internals)

Canonry’s web app is built with relative asset paths (./assets/...). At runtime, when --base-path is set, the server injects two things into every HTML response before it reaches the browser:

  1. <base href="/canonry/"> — tells the browser to resolve all relative URLs from the prefix, so ./assets/index.js → /canonry/assets/index.js
  2. window.__CANONRY_CONFIG__ = { ..., basePath: "/canonry/" } — the app reads this at startup to configure routing and API calls

This means a single pre-built canonry binary can be deployed at any path without rebuilding.