---
title: "Deploy Metabase Metrics"
description: "shared metrics definitions in Metabase"
category: "Analytics"
url: https://railway.com/deploy/metabase-metrics
---

# Deploy Metabase Metrics

shared metrics definitions in Metabase

**[Deploy Metabase Metrics on Railway](https://railway.com/template/metabase-metrics)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/metabase-metrics/manifest.json

- **Creator:** onepush
- **Category:** Analytics

## Template content

### metabase/metabase

- **Image:** metabase/metabase
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host self hosted Metabase Metrics (Open-Source BI) on Railway

Shared metric definitions end the revenue-vs-net_revenue arguments. Metabase pins one formula to one name in your own instance. Here's how to run that governed KPI layer on Railway without hiring a data platform team.

## About Hosting Metabase Metrics open-source software on Railway (self hosted Metabase template)

Deploy the official `metabase/metabase` image — pin `v0.63.x` or track `latest` — with a companion Postgres for app metadata, not analytics data. Warehouse tables stay in Postgres, MySQL, BigQuery, Snowflake, Redshift, or MongoDB.

## Why Deploy Metabase Metrics, the Tableau alternative on Railway (Railway Free Trial)

Tableau has unmatched visual grammar, but it assumes a Tableau admin, a server license, and an enterprise budget. Metabase gives a similar governed-metric workflow on your own infrastructure: define a metric once, publish to a curated collection, and let the company query it without SQL.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Metabase Metrics on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Metabase Metrics self hosting

Railway abstracts the server; DigitalOcean and Hetzner hand you a raw VPS where you run Docker, a reverse proxy, and TLS by hand. AWS offers a hundred services and a steep learning curve. Railway runs the container, terminates HTTPS at the edge, and attaches managed Postgres with a few clicks.

| Provider | Setup model | TLS/HTTPS | Postgres for app DB | Monthly cost (Metabase + DB) |
| --- | --- | --- | --- | --- |
| DigitalOcean | VPS + Docker Compose by hand | Manual Let's Encrypt | Self-managed on droplet | ~$12–24 |
| AWS | EC2 or ECS + RDS | Manual ALB/ACM | RDS Postgres | ~$30–60 |
| Hetzner | Bare VPS + Docker | Manual Caddy/Nginx | Self-managed or cloud PG | ~€8–15 |
| Railway | Managed container + template PG | Automatic at edge | ghcr.io/railwayapp-templates/postgres-ssl (17 ok) | ~$5–15 on Hobby |

Railway's Hobby tier plus the $5 GitHub trial credit means you can run a real governed metrics instance for a month before deciding if it earns a permanent slot.

## Common Use Cases for hosted Metabase Metrics

The first use case is usually unplanned: the CEO asks "what's our MRR?" and three people answer with three numbers. A shared Metabase metric — a saved SQL question or metric editor definition pinned to a verified collection — gives everyone the same answer.

## Dependencies for Metabase Metrics Docker hosted on Railway

Metabase is a single Java service, but the deployment has two mandatory moving parts and a few secrets that must survive redeploys.

### Deployment Dependencies for Managed Metabase Metrics Service (Business Intelligence)

The hard dependency is a Postgres database for Metabase's application metadata — not your analytics warehouse, which gets connected after first boot via Admin → Databases. The app Postgres stores users, permissions, saved questions, dashboards, collections, and metric editor definitions.

### Implementation Details for Metabase Metrics (Using Metabase official docker image)

The container listens on port 3000 and exposes a health check at `GET /api/health`. Railway's edge routes the public domain to that port; no reverse proxy config is needed. On first boot, Metabase runs migrations against the app Postgres, then serves the setup wizard where you create the admin user.

## How does Metabase Metrics compare against other metrics / governed KPI BI platforms

### Metabase Metrics vs Looker (Looker Alternative)

Looker invented the modern semantic layer — LookML is genuinely elegant, and its "one definition, every surface" promise predates most marketing. But Looker is a Google Cloud product with Google Cloud pricing, and LookML requires a developer to write version-controlled YAML before anyone sees a chart.

### Metabase Metrics vs Cube (Cube Alternative)

Cube is a headless metrics layer built for developers who want to serve metric definitions to their own apps via GraphQL or REST. That's a different job. If your team already has a React frontend and needs "active_users" as an API call with caching and access control, Cube is right.

### Metabase Metrics vs Holistics (Holistics Alternative)

Holistics is the closest philosophical match: a BI tool built around a semantic modeling layer where metrics are defined once and reused across reports. Its modeling language is more structured than Metabase's SQL-centric approach, and its dbt integration is tighter.

### Metabase Metrics vs Tableau (Tableau Alternative)

Tableau's metric layer — Tableau Pulse, Tableau Metrics — is genuinely good, but it lives inside a licensing model that assumes an enterprise procurement cycle.

## How to use Metabase Metrics (the OSS Business Intelligence)?

Using Metabase as a governed metrics layer is less about the tool and more about a workflow. Start by creating a "Company KPIs" collection with restricted edit permissions.

## How to self host Metabase Metrics on other VPS Services (Metabase Metrics self hosting guide)

Railway is not the only way to run this, and knowing the manual path makes you a better operator on any platform.

### Clone the Repository

Metabase's OSS source is on GitHub under `metabase/metabase`. You do not need to clone it to deploy — the official Docker image is the supported path — but cloning is useful for reading default config, checking the AGPL license, or auditing what a release changed before you upgrade.

### Install Dependencies

On a bare VPS, you need Docker or a JRE 11+. Docker is simpler: pull `metabase/metabase:latest` or pin a tag like `v0.63.x`. Then provision a Postgres 14+ instance, either on the same host via Docker or as a managed service. Install a reverse proxy — Caddy is the least painful — to terminate TLS and forward to port 3000.

### Configure Environment Variables

Export the same six `MB_DB_*` variables pointing at your Postgres, set `MB_ENCRYPTION_SECRET_KEY` to a long random string (`openssl rand -hex 32` works), and set `MB_SITE_URL` to your public domain. Put these in a systemd environment file or a `docker-compose.yml` env section so they survive reboots.

### Start the Metabase Metrics Application

Run `docker run -d -p 3000:3000 --env-file .env metabase/metabase:latest`, then check `http://your-server:3000/api/health` until it returns a JSON OK. The first boot takes a minute or two while migrations run. Then open the site, complete the setup wizard, create the admin user, and add your analytics databases.

## Official Pricing of Metabase Metrics (Metabase Metrics pricing)

Metabase OSS is free under the AGPL. Metabase Cloud Starter runs about $85 per month plus per-user fees, and the Pro tier — which adds SSO, row-level permissions, and interactive embed features that OSS lacks — is substantially higher.

## Metabase Metrics cloud vs self hosted comparison (Pricing, features, costs, and more)

### Monthly cost of self hosting Metabase Metrics on Railway

A small Metabase plus Postgres stack on Railway's Hobby tier typically runs about $5 to $15 per month. That covers compute for the Metabase container and the companion Postgres service.

### System Requirements for Hosting Metabase Metrics on a VPS

Metabase is a Java application, and Java likes memory. A VPS with 2 GB RAM and 2 vCPUs is the realistic floor for a small team; 4 GB is comfortable once dashboards multiply and multiple users run simultaneous queries.

## Frequently Asked Questions (FAQs)

### What happens if I don't set MB_DB_TYPE and let Metabase use H2?

Your instance becomes a sand castle. Every redeploy replaces the container, the H2 file vanishes, and your users, dashboards, and metric definitions reset to factory defaults. It's fine for a ten-minute demo and a resume-generating event in production.

### Can I connect my analytics warehouse after the first boot?

Yes, and that is the intended flow. The setup wizard creates the admin user, then you go to Admin → Databases and add Postgres, MySQL, BigQuery, Snowflake, Redshift, MongoDB, or any JDBC-supported source. The app Postgres and the analytics databases are completely separate connections.

### Why does MB_ENCRYPTION_SECRET_KEY matter so much?

Metabase encrypts stored credentials — database passwords, SMTP secrets — using that key. Rotate it and every encrypted value becomes unreadable, which means re-entering every database credential and email config by hand. Generate it once, store it in Railway's shared variables, and treat it like a root password.

### Does Metabase OSS support SSO?

No. SAML SSO, row-level permissions, and interactive embedding are Pro-tier features. OSS supports Google Sign-In and LDAP in some versions, but if your company requires enterprise SSO, that is the strongest argument for Metabase Cloud or the Pro license.

### How do I back up my governed metrics definitions?

Back up the app Postgres database. Every saved question, dashboard, collection, permission, and metric editor definition lives there. A nightly `pg_dump` of the app database — not your analytics warehouse, just the Metabase app DB — is a complete backup of your metrics governance layer.

### Can I run multiple Metabase instances against one app Postgres?

Technically yes, but the template does not set that up. Running two Metabase containers pointed at the same app Postgres can work for basic failover, but cache invalidation, session handling, and migration locking make it fragile. For a governed KPI layer on a budget, one solid instance is better than two fragile ones.


## Similar templates

- [Formbricks | Open-Source Typeform & Qualtrics Alternative](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube
- [Typesense PHP](https://railway.com/deploy/typesense-php) — official PHP client against Railway
- [Typesense vs Meilisearch](https://railway.com/deploy/typesense-vs-meilisearch) — self-hosted Typesense vs Meilisearch

Open this page in a browser: https://railway.com/deploy/metabase-metrics
