Skip to content

Production Deployment

Ciaren is local-first, but you can host it for a team on a trusted network. One ciaren serve process serves the editor, the API, and the scheduler on a single port, so a deployment is that process, a database, a data volume, and usually a reverse proxy for TLS.

Before you expose Ciaren

Ciaren has not had a formal independent third-party security audit. The API is unauthenticated by default and can run code (Python Transform nodes, plugin install). Before you bind beyond localhost, set CIAREN_API_TOKEN, put Ciaren behind trusted access controls, and read the security notes. ciaren serve prints a warning when you bind a non-loopback address without a token.

Checklist

  1. Install and bind. The wheel bundles the editor.

    bash
    python -m pip install ciaren
    ciaren serve --host 0.0.0.0 --port 8055 --log-level info
  2. Label the environment. Set CIAREN_ENVIRONMENT=production. It also makes ciaren db reset refuse to run without --force.

  3. Require a token. Set CIAREN_API_TOKEN to a long random value. Open the editor at https://your-host/?api_token=<token>. It keeps the token for that browser tab session. Scripts send Authorization: Bearer <token>.

  4. Use a managed database. Set CIAREN_DATABASE_URL to PostgreSQL or MySQL (see Database and data directory) and run ciaren db upgrade before each start.

  5. Persist the data directory. Put CIAREN_DATA_DIR on a volume you back up.

  6. Run it under a supervisor such as systemd or Docker, so it restarts after a crash. See Docker.

  7. Add the probes below and, if you ship logs to a collector, set CIAREN_LOG_FORMAT=json (one JSON object per line).

For the settings that matter on a shared server (execution mode, run timeout, connector guards), see Execution tuning and the Configuration Reference.

Reverse proxy and origins

Ciaren serves the built editor and /api from the same origin, so one upstream is enough. This nginx server block terminates TLS in front of it:

nginx
server {
  listen 443 ssl;
  server_name ciaren.example.com;
  # ssl_certificate ... ; ssl_certificate_key ... ;

  client_max_body_size 200m;      # at least CIAREN_MAX_UPLOAD_SIZE_MB

  location / {
    proxy_pass http://127.0.0.1:8055;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_buffering off;          # lets live run logs stream
  }
}

nginx rejects bodies over 1 MB by default, so raise client_max_body_size or uploads fail before they reach Ciaren.

Browser requests that change data are checked against the page's origin. With CIAREN_API_TOKEN set, the token already defeats cross-site requests and the check steps aside. Without a token, add the public hostname to CIAREN_TRUSTED_HOSTS, or the UI gets 403 on every save:

bash
CIAREN_TRUSTED_HOSTS='["ciaren.example.com"]'

You only need CIAREN_CORS_ORIGINS when a page on a different origin calls the API, for example the Vite dev server on port 5173 against a remote backend.

Health probes

EndpointUse asBehavior
/healthliveness probeAnswers while the process is up
/readyreadiness probeReturns 503 until the database is reachable

Neither needs the API token. See REST API conventions.

See also