---
title: "Deploy Metabase | Open-Source BI & Dashboard Tool"
description: "Self-Host Metabase | Self-service analytics, dashboards, and exploration"
category: "Other"
url: https://railway.com/deploy/self-host-metabase
---

# Deploy Metabase | Open-Source BI & Dashboard Tool

Self-Host Metabase | Self-service analytics, dashboards, and exploration

**[Deploy Metabase | Open-Source BI & Dashboard Tool on Railway](https://railway.com/template/self-host-metabase)**

- **Creator:** Heimdall
- **Category:** Other
- **Total deploys:** 33

## Template content

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

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

### Metabase https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/metabase.svg

- **Image:** metabase/metabase:latest
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

![metabase](https://www.altnix.com/_next/static/media/metabase.1d235005.png)

# Deploy and Host Metabase on Railway

This Railway template deploys a fully functional, self-hosted **Metabase** instance backed by a production-ready PostgreSQL database — all in a single one-click deploy. Two services are provisioned automatically: the `metabase/metabase` Docker image running the BI application, and a Railway-managed Postgres instance that stores all of Metabase's configuration, users, questions, and dashboards persistently. 

![Metabase dashboard screenshot](https://res.cloudinary.com/asset-cloudinary/image/upload/v1773207624/metabase-homepage_mtioym.png)
---

## Getting Started with Metabase on Railway

Once the deploy completes (expect 2–4 minutes for Metabase's first-boot migrations to finish), open the public domain generated for your Metabase service. You'll be greeted by the Metabase setup wizard — create your admin account, pick a display language, and optionally connect your first data source. If you don't have a database ready, click **I'll add my data later** to explore the built-in sample dataset.

After setup, head to **Admin Settings → Databases → Add a database** to connect your own PostgreSQL, MySQL, MongoDB, BigQuery, Redshift, or other data source. Once connected, Metabase auto-scans your schema and you can immediately start building questions and dashboards.

### Connecting Metabase to a Database Using the Connection URL

The quickest way to connect Metabase to any Railway Postgres database is via the connection string:

1. Go to your Postgres service in Railway → **Variables** tab
2. Copy the value of `DATABASE_PUBLIC_URL`
3. In Metabase, go to **Admin → Databases → Add a database**
4. Select **PostgreSQL**, then paste the URL into the **Connection string** field — Metabase will auto-fill all host, port, user, password, and database fields


![Connecting databases in metabase](https://res.cloudinary.com/asset-cloudinary/image/upload/v1773207624/connect-to-database_u4gnti.png)

---

## About Hosting Metabase

Metabase is an open-source business intelligence and data visualization platform trusted by over 90,000 companies. It lets anyone — technical or not — ask questions about data and get visual answers without writing SQL. It connects to 20+ data sources and queries them directly; no data extracts or ETL pipelines required.

**Key features:**
- Visual query builder — join tables, filter, group, and visualize without SQL
- Native SQL editor for technical users, with snippet sharing
- 15+ chart types, interactive dashboards, and drill-through analytics
- Scheduled email/Slack reports and data alerts
- Embedded analytics (static on open-source; interactive on Pro/Enterprise)
- Group-based permissions, SSO (Pro+), and row-level sandboxing (Pro+)
- Connects to PostgreSQL, MySQL, MongoDB, BigQuery, Snowflake, Redshift, and more

---

## Why Deploy Metabase on Railway

Self-hosting Metabase on a bare VPS means provisioning a server, installing Docker, configuring Postgres, managing SSL, handling restarts, and maintaining backups yourself. On Railway, all of that is handled for you:

- **Private networking** — Metabase talks to Postgres over an internal hostname, never the public internet, with zero config
- **Managed infrastructure** — Railway handles container orchestration, restarts, and uptime monitoring
- **Persistent storage** — Postgres data survives redeploys with Railway's managed volume

The alternative — a DigitalOcean droplet or Linode instance — requires you to manage OS patches, Docker upgrades, database backups, and network firewall rules indefinitely.

---

## Common Use Cases

- **Internal team dashboards** — connect your production Postgres or MySQL and build KPI dashboards for ops, sales, and finance without writing a single report script
- **Startup analytics stack** — replace expensive tools like Looker or Tableau with a free, self-hosted Metabase instance that the whole team can use from day one
- **Customer-facing embedded analytics** — embed static charts into your product UI using Metabase's open-source embedding (upgrade to Pro for interactive, signed embeds)
- **Ad-hoc data exploration** — let non-technical teammates query data on their own via the visual query builder, eliminating the "can you run this report for me?" bottleneck

---

## Dependencies for Metabase

- **Metabase** — `metabase/metabase:latest` ([Docker Hub](https://hub.docker.com/r/metabase/metabase))
- **PostgreSQL** — `ghcr.io/railwayapp-templates/postgres-ssl:17` — stores all Metabase application data (users, dashboards, questions, collections)


### Deployment Dependencies

- **Runtime:** Java 11+ (bundled inside the Docker image — no setup needed)
- **Docker Hub:** [metabase/metabase](https://hub.docker.com/r/metabase/metabase)
- **Official docs:** [metabase.com/docs](https://www.metabase.com/docs/latest/)
- **GitHub:** [github.com/metabase/metabase](https://github.com/metabase/metabase)

---

## Minimum Hardware Requirements for Self-Hosted Metabase

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2–4 GB |
| Storage (app) | 1 GB | 5 GB |
| Storage (Postgres) | 2 GB | 10+ GB |
| Java | 11 (bundled) | 11+ (bundled) |

> ⚠️ Metabase runs on the JVM. Under-provisioning RAM is the #1 cause of crashes. Plan for at least 1.5–2 GB RAM for stable operation with a small team.

---

## Is Metabase Free?

The open-source edition of Metabase is **completely free** under the AGPL license — no seat limits, no trial expiry. This Railway template deploys the open-source edition; you pay only for Railway infrastructure (compute + Postgres storage).

For teams that need managed cloud hosting, the **Starter** plan begins at ~$85/month (5 users). The **Pro** plan (~$500–575/month for 10 users) adds SSO, row-level permissions, white-labeling, and interactive embedding. An **Enterprise** plan (from ~$15,000–20,000/year) covers air-gapped deployments, dedicated support engineers, and custom pricing for embedded analytics at scale.

---

## Metabase vs Tableau vs Looker

| Feature | Metabase | Tableau | Looker |
|---|---|---|---|
| Open source | ✅ (AGPL) | ❌ | ❌ |
| Self-hostable | ✅ | ✅ (Server) | ❌ (cloud only) |
| Free tier | ✅ unlimited users | ❌ | ❌ |
| No-SQL query builder | ✅ | ✅ | ✅ (requires LookML) |
| Learning curve | Low | Medium | High (LookML) |
| Starting price (paid) | ~$85/mo | ~$840/user/yr | ~$60k/yr platform |
| Embedded analytics | ✅ static (free) / interactive (Pro+) | ✅ | ✅ |

Metabase is the go-to choice for startups and teams that need BI up and running quickly without SQL expertise or large BI budgets. Tableau and Looker are better suited to large enterprises with dedicated data teams and the budget to match.

---

## Self-Hosting Metabase Outside Railway

**Docker (quickest):**
```
docker run -d -p 3000:3000 \
  -e MB_DB_TYPE=postgres \
  -e MB_DB_HOST=your-postgres-host \
  -e MB_DB_PORT=5432 \
  -e MB_DB_USER=metabase \
  -e MB_DB_PASS=yourpassword \
  -e MB_DB_DBNAME=metabaseappdb \
  --name metabase metabase/metabase:latest
```

**With Docker Compose (Metabase + Postgres together):**
```
services:
  metabase:
    image: metabase/metabase:latest
    ports:
      - "3000:3000"
    environment:
      MB_DB_TYPE: postgres
      MB_DB_HOST: postgres
      MB_DB_PORT: 5432
      MB_DB_USER: metabase
      MB_DB_PASS: mysecretpassword
      MB_DB_DBNAME: metabaseappdb
    depends_on:
      - postgres

  postgres:
    image: postgres:16
    environment:
      POSTGRES_USER: metabase
      POSTGRES_DB: metabaseappdb
      POSTGRES_PASSWORD: mysecretpassword
    volumes:
      - pg_data:/var/lib/postgresql/data

volumes:
  pg_data:
```

Navigate to `http://localhost:3000` after both containers are healthy.

---

## FAQ

**What is Metabase?**
Metabase is an open-source business intelligence tool that lets teams connect databases and build dashboards, run queries, and share reports — without needing SQL knowledge. It's available as a free self-hosted install or a paid managed cloud service.

**What does this Railway template deploy?**
Two services: the official `metabase/metabase:latest` Docker image (the BI application on port 3000), and a Railway-managed PostgreSQL database that stores all Metabase configuration data — users, dashboards, collections, and questions. Both are pre-wired with environment variable references so they connect automatically on first boot.

**Why is PostgreSQL included — can't Metabase run without it?**
Metabase ships with an embedded H2 file database as a fallback, but it lives inside the container. Every redeploy wipes it, meaning you'd lose all dashboards and settings. The included Postgres service stores that data durably. This is the correct production setup per Metabase's own documentation.

**How do I connect my own database to Metabase for analysis?**
The Postgres service in this template is only for Metabase's internal config storage, not for your analytics data. After first login, go to **Admin → Databases → Add a database** and connect your own data sources (PostgreSQL, MySQL, BigQuery, etc.). For a Railway Postgres database you already have, copy `DATABASE_PUBLIC_URL` from its Variables tab and paste it as the connection string in Metabase.

**Can I use this template in production?**
Yes. This template uses the official Docker image, a production-grade Postgres 17 image with SSL, and Railway's private networking for internal communication. For teams needing SSO, row-level security, or interactive embedding, you can self-host the open-source edition freely and upgrade to a Pro license token when ready — no migration needed.

**Does Metabase support BigQuery, Snowflake, or Redshift?**
Yes. Metabase's open-source edition supports PostgreSQL, MySQL, MariaDB, SQLite, MongoDB, H2, and more. BigQuery, Snowflake, Redshift, Presto, Druid, and several others are also supported — connect them via **Admin → Databases** after deployment.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

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