Metabase
Explore Postgres data, build dashboards and share reports with Metabase.
- app
- analytics
- stack
Run it
briq run metabasebriq_run({ recipe: "metabase", wait: true })curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "metabase",
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "METABASE_URL": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"stack: app
services:
metabase:
recipe: metabase
# its defaults, each a field you can set:
# image: metabase/metabase:v0.63.19.2
# size: smallFields
| Name | Type | Options | Default |
|---|---|---|---|
| image | string | — | "metabase/metabase:v0.63.19.2" |
| env | record | { key: string | { secret, value?, literal?, scope?, hosts?, locations? } } | {} |
| cmd | string | string[] | — | — |
| size | enum | small, medium | "small" |
| files | record | { key: string | { base64 } } | — |
| egress | object | { hosts } | — |
Outputs
Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.
- METABASE_URL
- http://metabase.<stack>.internal:3000
- METABASE_ADMIN_EMAIL
- admin@metabase.local
- METABASE_ADMIN_PASSWORD
- <METABASE_ADMIN_PASSWORD>
- DATABASE_URL
- postgres://postgres:<WAREHOUSE_PASSWORD>@postgres.<stack>.internal:5432/warehouse
- READONLY_DATABASE_URL
- postgres://reporter:<REPORTER_PASSWORD>@postgres.<stack>.internal:5432/warehouse
What it runs
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| postgres | postgres:16-alpine | 5432 | nano | 10 GB at /var/lib/postgresql/data |
| metabase | metabase/metabase:v0.63.19.2 | 3000 | small | — |
When to use it
- You want a BI tool with a visual editor: questions, filters and dashboards built by clicking.
- The people reading the reports will also change them, without writing SQL.
- You want dashboards on a Postgres warehouse.
Two briqs: metabase serves the dashboards, postgres is the warehouse it reads. On first boot
Metabase makes its admin account (password in METABASE_ADMIN_PASSWORD) and connects the
warehouse as Warehouse, read through a read-only role: nobody signed in to Metabase can change
the data. For a dashboard written in SQL and shared from a link in under a minute, use
duckdb.
Tips
- Load from inside the warehouse: the image has
wget, sowget -qO- <csv url> | psql -U postgres -d warehouse -c "\copy t from stdin with (format csv, header)"inbriq_execnever sends the data through the agent. - Tables the agent creates as
postgresinpublicare readable by Metabase. Another schema needsGRANT USAGE ON SCHEMA s TO reporter; GRANT SELECT ON ALL TABLES IN SCHEMA s TO reporter. mbcalls Metabase's API as the admin frombriq_execon themetabasebriq:["mb", "GET", "/api/database"];["mb", "POST", "/api/card", "-"]with the JSON asstdin.- Native SQL questions (
dataset_query.type: "native") are the shortest way to a chart. After loading a new table,POST /api/database/<id>/sync_schemamakes it browsable in the UI too. - Share one dashboard:
POST /api/dashboard/<id>/public_linkreturns auuid; the page is/public/dashboard/<uuid>on the briq's URL. Run withexpose: "private"and keep the?briq_token=on the link you send, so the link is the only way in. - First boot takes about three minutes while Metabase migrates its database:
briq_runcan answer whilemetabaseis stillcreating;briq_statussays when it runs. Later starts are faster, and the dashboards survive stops. - Our World in Data files: aggregate rows (World, continents, income groups) have an empty
iso_code, notOWID_WRL. Match the world oncountry = 'World';iso_code IS NOT NULLkeeps the countries.