π₯ Meerschaum Stack¶
The Stack uses Docker Compose to run TimescaleDB, the Meerschaum API and web console, Valkey, and Grafana together. Start it with mrsm stack up -d.
See Upgrading the Stack for backups, restores, and database upgrades, or team execution environments to run isolated per-team executor services alongside the main API.
π³ Services¶
The default stack starts 4 services:
| Service | Description | Image |
|---|---|---|
db |
TimescaleDB instance backing sql:main. |
timescale/timescaledb-ha:pg18 |
api |
Production Meerschaum Web API and console (api:main). |
bmeares/meerschaum:<version>-full |
valkey |
Valkey cache backing valkey:main and API sessions. |
valkey/valkey-bundle:latest |
grafana |
Grafana pre-configured with sql:main. |
grafana/grafana:latest |
Edit the stack's Docker Compose configuration with mrsm edit config stack, or print the resolved Compose file with mrsm stack config.
The api service defaults to bmeares/meerschaum:<version>-full (linux/amd64 and linux/arm64), matching your installed mrsm release. After upgrading meerschaum, run mrsm stack up -d to recreate the api container on the new image while keeping your volumes. If an older config/stack.yaml pins bmeares/meerschaum:api, remove or update services:api:image to follow the release tag.
Entering the Meerschaum Docker image
Open a Meerschaum shell inside the running api container:
ποΈ The Database Setup¶
When db starts on an empty volume, Meerschaum mounts <root>/db/initdb/create-extensions.sql to /docker-entrypoint-initdb.d/100_meerschaum.sql:z,ro so the image's own setup scripts run first and Meerschaum's runs last:
- The image installs
timescaledbinpostgres,template1, andPOSTGRES_DB, disables telemetry (TIMESCALEDB_TELEMETRY: 'off'), runstimescaledb-tune(disable withNO_TS_TUNE: 'true'), and installstimescaledb_toolkit. create-extensions.sqlenablestimescaledb,postgis,timescaledb_toolkit, andpg_stat_statements(skipping any extension unavailable in a custom image) and appendspg_stat_statementstoshared_preload_libraries.
The db healthcheck polls TCP (pg_isready -h 127.0.0.1 -p 5432, 300-second start_period) so api and grafana wait until first-time initialization completes.
Setup runs once per volume
Docker only runs /docker-entrypoint-initdb.d when the data volume is empty. You can customize <root>/db/initdb/create-extensions.sql before your first mrsm stack up. For an existing database, run mrsm upgrade extensions.
Docker Images¶
Choose a variant of bmeares/meerschaum:
| Tag | Included | Best suited to |
|---|---|---|
full / latest |
Native CLI, Python SDK, all extras (Dash/API), Cargo, rustc, C/C++ build tools, pip, and Git |
First-time users and plugin development |
rust |
Native CLI, core API/MCP, database connectors, runtime libraries (no Python or compilers) | Small native deployments and prebuilt Rust plugins |
rust-full |
Everything in rust, plus Cargo, rustc, Git, and native build tools (no Python) |
Building .rs source plugins without Python |
slim / minimal |
Python and the base wheel (no optional extras or Rust toolchain) | Minimal Python deployments with custom dependencies |
api |
Deprecated alias of full |
Existing deployments |
Every variant runs the same Rust engine and config format. Dash and Python plugins require a Python variant (full or slim); .rs source plugins require Cargo (full or rust-full; mount /home/meerschaum/.cargo to persist downloaded crates).
Pin releases with {version}-{variant} (for example 5.0.2-rust or 5.0.2-full). Stable releases publish linux/amd64 and linux/arm64 and update floating tags; pre-releases publish versioned linux/amd64 tags only. Build locally with:
Upgrade containers by pulling the new image and recreating the serviceβmrsm upgrade mrsm inside a container reports image ownership rather than mutating the running image.
ποΈ Requirements¶
You need Docker installed to run the stack:
Install Docker Desktop.
π’ Starting the Stack¶
Bring up the database and Grafana (or omit service names to start the full stack):
mrsm stack wraps a pre-configured Docker Compose project (if docker-compose is missing, Meerschaum installs it automatically in an internal virtual environment). Open Grafana at http://localhost:3000 with username admin and password admin.

Built-in dashboards¶
The Stack provisions two dashboards in Grafana's Meerschaum Dashboards folder, reading the instance's mrsm_engine_* tables with Pipe and Pipeline filters:
- Syncs: Overview (totals, outcomes, P95 duration, rows affected/s, failure rate, retries, slowest pipes), plus per-Pipe and per-Pipeline breakdowns.
- Engine: Syncing Engine runs and outcomes, Pipe freshness and parent lag, dirty-range backlog, failed/retried nodes, and stream flushes.
Rows affected sum inserted, updated, upserted, and deleted rows (replacements count deleted plus new rows; unchanged syncs affect zero). On upgrades from 5.0.0rc34 or earlier, unmodified legacy performance dashboards are replaced automatically. Grafana queries the database directly using its data-source permissions; see Sync metrics for capture limits.
Grafana's read-only data source¶
Since 5.1, the provisioned Meerschaum Main data source connects as mrsm__main_roβa read-only PostgreSQL roleβinstead of sql:main's superuser, protecting stacks where Grafana anonymous access is enabled.
- Scope: Reads
public, schemas owned bysql:main, and any extra schemas listed instack:grafana:readonly_schemas. Never sees isolated team schemas or databases, and cannot write, create objects, or install extensions. - Setup: On every
mrsm stack up, a one-shotgrafana_readonlyservice creates or reconciles the role (password stored in<root>/api/.grafana_readonly_password) oncedbis healthy. A stack without adbservice warns and never falls back to owner credentials. - Compose generation: Run
mrsm stack config(or anymrsm stackcommand) to writestack/docker-compose.yamlbefore callingdocker composedirectly.
To allow Grafana to query an extra schema, add it in mrsm edit config stack and run mrsm stack up -d:
Credentials in files¶
Since 5.1, mrsm stack delivers credentials as mounted read-only files under <root>/stack/secrets/ (0700 on host) at /run/secrets/meerschaum instead of embedding secrets in docker-compose.yaml or docker inspect. Each container receives a io.meerschaum.secrets-revision label so mrsm stack up -d recreates containers when credentials change.
| Service | Host file (under <root>/stack/secrets/) |
Container usage |
|---|---|---|
api |
api/mrsm_config.json, api/mrsm_patch.json |
MRSM_CONFIG_FILE, MRSM_PATCH_FILE |
grafana |
grafana/admin_password |
GF_SECURITY_ADMIN_PASSWORD__FILE |
grafana_readonly |
grafana_readonly/owner_password, readonly_password |
Read by role-setup script |
valkey |
valkey/valkey.conf (requirepass) |
valkey-server /run/secrets/meerschaum/valkey.conf |
- Image compatibility: File-based API config activates automatically for
bmeares/meerschaum5.1.0+. Older or custom images keep environment variables with a warning; setapi_config_files: true(orfalse) inmrsm edit config stackto override. - Valkey password: Valkey images ignore
VALKEY_PASSWORD, somrsm stackenforcesrequirepassusingvalkey:main's password. Ifvalkey:mainhas no password, one is generated in<root>/stack/secrets/.valkey_password(link it withpassword: MRSM{file:<root>/stack/secrets/.valkey_password}). - Environment variables kept:
POSTGRES_PASSWORDremains interpolated as$POSTGRES_PASSWORDondbso maintenance commands can read it from the running container. Grafana's provisioneddatasource.yamlstores only the read-only role's password.
πΎ Backups and Upgrades¶
Use mrsm backup postgres for online snapshots, mrsm restore postgres to verify and restore into a new volume, mrsm upgrade postgres for PostgreSQL major upgrades, and mrsm upgrade extensions to update database extensions. See Upgrading the Stack.
π Stopping the Stack¶
Stop all running services:
Stop services and delete all volumes:
Data Loss Warning
mrsm stack down -v deletes every volume in the stack, including all pipe data. To remove a single service's volume instead, use Docker directly:
π Editing the Stack¶
Database and cache credentials are linked automatically from your connectors (mrsm edit config). Edit the Compose configuration directly with: