# Deploy Metabase with the Metabase template

Source: https://docs.quake.ai/resources/deployments/deploy-metabase-template
Markdown: https://docs.quake.ai/resources/deployments/deploy-metabase-template.md

---

# Deploy Metabase with the Metabase template

Stand up [Metabase](https://www.metabase.com), an open-source BI tool, on a single Quake AI instance using the [validated OpenTofu template](/docs/platform/validation#how-infrastructure-templates-are-checked) `metabase`. You apply the template, complete the setup wizard, connect a warehouse, and build a first dashboard.

Metabase is the analyst-facing layer over a warehouse you already run. This is a self-hosted tool you operate, not a managed BI service.

<PricingCompanion
  components={[
    { kind: "template", slug: "metabase", required: true },
  ]}
/>

## Prerequisites

You need:

- OpenTofu 1.6.0 or later installed locally.
- Your OpenStack credentials sourced into the shell (`source openrc.sh`). See [the OpenStack CLI guide](/docs/tools/openstack-cli).
- An SSH keypair that already exists in your project.
- A copy of the `metabase` template directory from [the template reference page](/resources/iac-templates/metabase).
- Your workstation's public IP address if you plan to open port 3000 for first-boot setup (`curl -sS https://api.ipify.org`).

A [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres) warehouse is optional for this walkthrough but required for real dashboards. Deploy the warehouse first if you do not have one.

## Step 1: Set the variables and apply the template

The UI listens on port 3000 over plain HTTP. The security group restricts port 3000 to `editor_allowed_cidr`, which defaults to the private network only. To reach the UI from your workstation for setup, set `editor_allowed_cidr` to your public IP.

```bash
cp terraform.tfvars.example terraform.tfvars
```

```hcl
key_name            = "YOUR_KEY_NAME"
editor_allowed_cidr = "YOUR_IP/32"
```

```bash
tofu init
tofu plan
tofu apply
```

When the apply finishes, record `floating_ip` and `ui_url` from `tofu output`.

## Step 2: Complete the setup wizard

cloud-init takes a minute or two after the instance reaches `ACTIVE`. Open `ui_url` (for example `http://YOUR_FLOATING_IP:3000`) in your browser.

When the setup screen appears, enter an email, company name, and admin password. Metabase creates the admin account and opens the home screen.

## Step 3: Connect a warehouse and save a question

1. Open **Admin** > **Databases** > **Add database**.
2. Choose **PostgreSQL** and enter the private IP, database name, user, and password for your [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres) warehouse.
3. Click **Save**. Metabase syncs schemas and tables.
4. Open **New** > **Question**, pick a table, and save a simple count or filter question.

You now have a self-hosted BI layer over a warehouse on Quake AI.

## Step 4 (optional): Serve the UI over HTTPS

Put Caddy or Nginx in front of Metabase on ports 80 and 443, point a DNS A record at the floating IP, and proxy to `127.0.0.1:3000`. See [How to point a domain at a Quake AI resource](/docs/network/how-to/point-domain-to-quake-ai).

## Tear down

```bash
tofu destroy
```

## See also

- [Metabase template reference](/resources/iac-templates/metabase)
- [Self-service BI stack](/resources/solutions/self-service-bi-stack)
- [self-managed PostgreSQL](/resources/iac-templates/self-managed-postgres)
