---
title: Deploy Metabase
url: "/guides/metabase/"
canonical_url: https://docs.blossom88.com/guides/metabase/
markdown_url: https://docs.blossom88.com/guides/metabase.md
summary: Deploy private business dashboards with your AI agent, managed PostgreSQL,
  and a connection to your reporting data.
categories:
- deployment
- analytics
---

# Deploy Metabase

[Metabase](https://www.metabase.com/) is a business intelligence tool for
exploring data and sharing charts and dashboards. Connect a database and
build reports through its visual editor or SQL.

Ask your agent to run Metabase on Blossom, connect your reporting data, and
keep saved questions and dashboards across app updates.

[Install the Blossom CLI and skill](/learn/getting-started/install/)
on your agent's machine and choose a Blossom Cloud Location when you log in.
You can also use
[Blossom BYOC (bring your own cloud)](/learn/getting-started/choose-your-cloud/#blossom-byoc).
Have a database to report on, or ask your agent to create sample data.

## Ask Your Agent


> **Ask your AI agent:** Deploy Metabase on Blossom with managed Postgres. Help me connect my data and
> build a private dashboard.

> Follow this guide: https://docs.blossom88.com/guides/metabase/



Your agent selects maintained compatible releases and saves the choices
with your deployment configuration.

| Part | Purpose |
|---|---|
| Metabase web Service | Runs the query editor and dashboards |
| Managed PostgreSQL | Keeps Metabase users, settings, saved questions, and dashboards |
| Reporting database | Holds the business data you explore |
| Private HTTPS access | Account membership followed by your Metabase login |

The application database stores Metabase's own settings and reports. Your
reporting database is a separate connection to the data you want to query.
Give that connection read access to the data it needs.

The agent keeps the encryption and session secrets stable across deployments
so Metabase can continue reading saved connection settings. Create your
Metabase administrator account when the app first opens.

<details class="optional-reading" markdown="1">
<summary>Commands behind the deployment</summary>

Your agent prepares the files using current CLI help and Metabase's
[deployment documentation](https://www.metabase.com/docs/latest/installation-and-operation/running-metabase-on-docker).
Use the IDs returned by Blossom in place of these examples.

### Create the App and Application Database

    blossom profile:show
    blossom app:create --data '{"app":{"name":"metabase"}}'

The agent writes environment.yml with your App ID and an official image
suited to the Location's architecture:

```yaml
environment:
  app_id: app-100
  name: production
  source_type: prebuilt_image
  prebuilt_image: <official image pinned by your agent>
  access_mode: members
```

It prepares database_instance.yml for managed PostgreSQL with a compatible
release, storage, resources, and backups for your workload.

    blossom environment:create --data environment.yml
    blossom database_instance:create --data database_instance.yml --follow
    blossom database:list --database_instance database_instance-100
    blossom environment_link:create --data '{"environment_link":{"environment_id":"environment-100","target_type":"Database","target_id":"database-100","var_name":"DATABASE_URL"}}'

### Configure and Deploy Metabase

The agent maps Blossom's private `DATABASE_URL` to Metabase's application
database settings. It stores the encryption key and other runtime settings
in a private .env.production file outside the application repository.

Keep `MB_ENCRYPTION_SECRET_KEY` and `MB_SESSION_SECRET_KEY` in that private
file and retain them across updates.

    blossom env_var:push --environment environment-100 --file .env.production

Configure a unique `org.quartz.scheduler.instanceId` for each Container at
startup, for example by deriving it from the Container's hostname without a
DNS lookup. Supply it as a Java system property in `JAVA_TOOL_OPTIONS`.
When writing a Service command in CLI input, escape runtime dollar signs
as `$$`; `blossom help:data` explains that syntax.

It writes service.yml with the selected image's startup command, resources,
and an HTTP health check at `/api/health`. Metabase keeps its application
data in PostgreSQL, so the web Service uses regular App Capacity without
an attached Volume.

    blossom service:create --data service.yml
    blossom environment:deploy --id environment-100 --follow
    blossom environment:show --id environment-100

</details>

## Connect Data and Build a Dashboard


> **Ask your AI agent:** Help me connect my data and build a dashboard. Use sample data if I do not
> have any ready.

> Follow this guide: https://docs.blossom88.com/guides/metabase/



Save the reporting connection through Metabase's database settings. Use the
visual query editor or SQL to build a question, then add it to a dashboard.
Choose a useful metric, such as orders by month or revenue by product. For
a demo, create synthetic data in a separate reporting database.

![Metabase showing a business dashboard built from synthetic reporting data.](/assets/images/metabase/dashboard.png)

## Keep Reports Across App Updates


> **Ask your AI agent:** Redeploy Metabase and check that my dashboard and database connection still
> work.

> Follow this guide: https://docs.blossom88.com/guides/metabase/



Reopen a saved question and run a fresh query after the update.

<details class="optional-reading" markdown="1">
<summary>Commands to inspect and update the App</summary>

    blossom service:show --id service-100
    blossom environment:deploy --id environment-100 --follow
    blossom logs --environment environment-100 --lines 30

</details>

For larger teams, have your agent use
[Metabase's scaling guidance](https://www.metabase.com/learn/metabase-basics/administration/administration-and-operation/metabase-at-scale)
to plan query capacity and additional instances sharing the application
database.

## What You Get

- A private HTTPS dashboard for exploring your data
- Saved users, questions, and dashboards in managed PostgreSQL
- A reporting connection to your business data
- Reports and connection settings that survive app updates
