Docker
Ciaren ships a multi-stage Docker image that bundles the React editor and the FastAPI backend in one container. You get one port and one volume for data, and you need no Python or Node.js on the host.
Prerequisites
Docker Engine 24 or later with Docker Compose v2. Docker Desktop includes both. The image already contains Python 3.13, the backend packages, and the built editor.
Quick start
git clone https://github.com/ciaren-labs/Ciaren.git
cd Ciaren
# build and start (SQLite, no extras; the first build takes about 3 minutes)
docker compose up --buildOpen http://localhost:8055.
On every start, the entrypoint runs ciaren db upgrade before it starts the
server, so the first boot takes a few extra seconds.
Image layout
| Path in the container | Purpose |
|---|---|
/app/ | Ciaren source and its virtual environment (/app/.venv/) |
/app/app/web/ | The built editor, served by FastAPI |
/data/ | Persistent volume: SQLite database, uploads, run outputs, MLflow |
/data is the only path that changes at runtime. Use a named volume (the default)
or a bind mount to control where the data lives on the host. The container runs as
a non-root ciaren user, so a bind-mounted folder must be writable by it.
Keep MLflow data inside /data
The image sets CIAREN_MLFLOW_TRACKING_URI=/data/mlruns, so trained models and run
history survive container recreation. If you override it, use an absolute path
under /data or a remote tracking server URI. A relative path resolves against
/app, which is not in the volume and is discarded when the container is
recreated.
Configuration
Any CIAREN_* setting works as an environment variable. docker-compose.yml
already passes the common ones through shell variables with defaults, so you can
override them without editing the file:
CIAREN_DEFAULT_ENGINE=pandas docker compose up
CIAREN_MAX_UPLOAD_SIZE_MB=500 docker compose up
CIAREN_SCHEDULER_ENABLED=false docker compose upOr put them in a .env file next to docker-compose.yml (never commit it):
CIAREN_MAX_UPLOAD_SIZE_MB=500
CIAREN_DEFAULT_ENGINE=pandas
CIAREN_EXECUTION_MODE=process
CIAREN_SCHEDULER_MAX_CONCURRENT_RUNS=3
CIAREN_RUN_TIMEOUT_SECONDS=300Compose passes only the variables listed in docker-compose.yml. To set another
one, such as CIAREN_API_TOKEN, add it to an override file:
# docker-compose.override.yml
services:
ciaren:
environment:
CIAREN_API_TOKEN: ${CIAREN_API_TOKEN}Every variable is in the Configuration Reference.
docker compose exec ciaren ciaren info prints the resolved values.
Flow assistant in a container
The flow assistant stays off until the server has a provider
key. A container has no OS keychain, so the Connections → Assistant API keys
page cannot save a key there. Give the server the provider settings and a mounted
secret file instead, and keep the file outside the image and the repository.
Because docker-compose.yml does not list the CIAREN_ASSISTANT_* variables, add
them in docker-compose.override.yml:
services:
ciaren:
environment:
CIAREN_ASSISTANT_PROVIDER: openai
CIAREN_ASSISTANT_OPENAI_KEY_SOURCE: file
volumes:
- /srv/private/ciaren/openai:/run/ciaren-assistant-secrets/openai:roRecreate the service with docker compose up -d --build ciaren. The other
providers, the full variable list, and the data that leaves the server are in
Run the flow assistant on a server.
Set CIAREN_ASSISTANT_ENABLED=false to turn it off.
Optional extras
Extras are installed at build time through the EXTRAS build argument, a
comma-separated list. scikit-learn, MLflow, and joblib ship in every image, so the
ML nodes work with no extra. EXTRAS adds:
| Extra | Adds |
|---|---|
ml | XGBoost and LightGBM model choices |
postgres | asyncpg and psycopg: PostgreSQL support |
mysql | pymysql: MySQL connector for SQL nodes |
mongo | pymongo: MongoDB support |
mssql | pyodbc: SQL Server support. Also installs unixodbc and Microsoft's msodbcsql18 driver |
duckdb | duckdb: DuckDB support |
snowflake | snowflake-sqlalchemy: Snowflake support |
s3 | boto3: AWS S3 storage connections |
gcs | google-cloud-storage: Google Cloud Storage connections |
azure | azure-storage-blob: Azure Blob Storage connections |
signing | cryptography: verify plugin package signatures instead of skipping them |
all-connectors | postgres, mysql, mongo, mssql, duckdb, snowflake, s3, gcs, and azure |
all | alias for all-connectors |
EXTRAS=ml docker compose build && docker compose up # XGBoost and LightGBM
EXTRAS=ml,postgres docker compose build && docker compose up # plus PostgreSQLChanging EXTRAS requires a rebuild, because the packages are baked into the
image.
mssql and the Microsoft EULA
Building with EXTRAS=mssql (or all-connectors or all) pulls Microsoft's
msodbcsql18 package from Microsoft's apt repository and passes ACCEPT_EULA=Y,
which accepts the ODBC Driver for SQL Server license
terms
on your behalf during the build. Without the driver, every SQL Server connection
fails with "Data source name not found and no default driver specified."
Change the port
CIAREN_PORT=9000 docker compose upWithout Compose, publish a different host port: docker run -p 9000:8055 ciaren:latest.
Data persistence
docker-compose.yml uses a named volume, ciaren-data. Uploads, run outputs, the
SQLite database, and MLflow data all live there. To use a bind mount instead,
which is easier to inspect and back up:
# docker-compose.override.yml
services:
ciaren:
volumes:
- ./my-ciaren-data:/dataUse PostgreSQL
-
Rebuild with the
postgresextra:EXTRAS=postgres docker compose build. -
Set the database URL when you start the service, or add it to your
.env:CIAREN_DATABASE_URL=postgresql+asyncpg://user:pass@host:5432/ciaren \ docker compose up
The URL needs an async driver: postgresql+asyncpg://, mysql+aiomysql://, or
sqlite+aiosqlite://. The postgres extra includes the app driver (asyncpg).
The mysql extra is for SQL nodes and does not add aiomysql, so using MySQL as
Ciaren's own database needs a custom image. See
Database and data directory.
Run CLI commands in the container
docker compose exec ciaren ciaren info # resolved settings
docker compose exec ciaren ciaren check # data dir, database, engines, ML
docker compose exec ciaren ciaren db current # migration revision
docker compose exec ciaren ciaren transformations list # node typesWithout Compose:
docker run --rm \
-e CIAREN_DATABASE_URL=sqlite+aiosqlite:////data/ciaren.db \
-v ciaren-data:/data \
--entrypoint ciaren \
ciaren:latest infoBuild the image yourself
docker build -t ciaren:latest . # SQLite, polars, pandas, built-in ML
docker build --build-arg EXTRAS=ml -t ciaren:ml . # plus XGBoost and LightGBM
docker build --build-arg EXTRAS=ml,postgres -t ciaren:full . # several extrasThe build has two stages: node:22-alpine builds the editor and is discarded, and
python:3.13-slim holds only the runtime. Skip extras you do not need to keep the
image small.
Production checklist
- Set
CIAREN_API_TOKEN. The container binds0.0.0.0, and the API is unauthenticated by default and can run code. Without a token, Ciaren prints a warning at startup. Use a token, an authenticating reverse proxy, or both. - Keep
CIAREN_ENVIRONMENT=production. Compose sets it by default. It makesciaren db resetrefuse to run unless you also pass--force. - Mount
/dataas a named volume or bind mount so data survives container replacement, and back it up. It holds the database and every uploaded file. - Set
CIAREN_CORS_ORIGINSonly if a page on another origin calls the API. It is not needed when the editor and API share a port. - Pin the image tag. Build with a version tag such as
docker build -t ciaren:0.5.0 .and use it instead oflatestin production compose files. - Run behind a reverse proxy such as nginx, Caddy, or Traefik for TLS. The image does not terminate TLS. See Production deployment.
Troubleshooting
The container exits immediately
Run docker logs <container-id>. Common causes are a /data directory the
container user cannot write to, or a CIAREN_DATABASE_URL with a sync driver.
ciaren check finds both.
The health check fails
The health check polls /health every 30 seconds after a 60-second start period.
If a long migration makes the server slower to start, raise start_period in
docker-compose.yml.
For Kubernetes or a load balancer, use /ready as the readiness probe. It
returns 503 until the database is reachable, so traffic arrives only when the
instance can serve it. Keep /health as the liveness probe, so a transient
database problem does not restart a healthy process.
ML nodes are missing
The image includes scikit-learn, MLflow, and joblib, so the ML nodes disappear only
if CIAREN_ML_ENABLED=false or the image was stripped down. Check with
docker compose exec ciaren ciaren check. A [warn] ml: ... line means ML is
disabled or a library is missing. XGBoost and LightGBM model choices need the ml
extra: rebuild with EXTRAS=ml.
Trained models or MLflow history disappeared after a redeploy
CIAREN_MLFLOW_TRACKING_URI must point inside the /data volume. The default,
/data/mlruns, does. If you set a relative path or a path outside /data, MLflow
wrote into the container's writable layer, which is gone once the container is
recreated. Set it back to an absolute /data/... path (or an external MLflow
server) and retrain.
SQL Server fails with "no default driver specified"
The image has the msodbcsql18 driver only when built with EXTRAS=mssql (or
all-connectors or all). unixodbc alone is the driver manager with no driver
registered. Rebuild with EXTRAS=mssql docker compose build && docker compose up.
Port already in use
Run CIAREN_PORT=9001 docker compose up.
See also
- CLI Reference: every
ciarencommand and flag - Configuration Reference: every variable
- Production deployment: hosting for a team