---
title: Deploy Metabase with AI on Blossom
url: "/deploy/metabase/"
canonical_url: https://blossom88.com/deploy/metabase/
markdown_url: https://blossom88.com/deploy/metabase.md
summary: Deploy Metabase with AI on Blossom. Self-host private dashboards with managed
  PostgreSQL and connect your own reporting data.
categories:
- deployment
- analytics
---

# Deploy Metabase with AI on Blossom

[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

> **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://blossom88.com/deploy/metabase/

[Install the Blossom CLI and skill](https://docs.blossom88.com/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)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Your Reporting Setup

| 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 |

Managed PostgreSQL keeps Metabase's accounts, questions and dashboards.
Connect your business data separately using a read-only reporting connection.
Keep the dashboard behind Blossom Account access and Metabase sign-in.

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

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

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.

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>

## Build Your First Dashboard

Create the administrator, connect your reporting database and save a question.
Add it to a dashboard using the visual editor or SQL. Start with synthetic
sample data if you do not have a database ready.

<details class="optional-reading" markdown="1">
<summary>Updates and storage</summary>

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

### Commands to inspect and update the App

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

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.

</details>

## 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
