Railway

Deploy Self-Hosted Metabase — Business Intelligence Without the $85/Month Cloud Bill

Self-host Metabase BI — no $85/month cloud bill. Free for your whole team.

Deploy Self-Hosted Metabase — Business Intelligence Without the $85/Month Cloud Bill

/var/lib/postgresql/data

Just deployed

Deploy and Host Metabase on Railway

Metabase business intelligence dashboard

Metabase is the most popular open-source business intelligence platform — no-code visual query builder, full SQL editor, dashboards, alerts, scheduled reports, and embedded analytics for 20+ databases including PostgreSQL, MySQL, MongoDB, BigQuery, Snowflake, and Redshift. Your entire team can explore data and build charts without waiting for an analyst.

Metabase Cloud starts at $85/month plus $5/user. Self-hosting on Railway costs ~$5–10/month flat for your entire team with no user caps, no plan limits, and full ownership of every dashboard and dataset your team builds.


What This Template Deploys

ServicePurpose
MetabaseThe BI platform — no-code query builder, SQL editor, dashboards, alerts, scheduled reports, and embedded analytics UI on port 3000
PostgreSQL 17 (SSL)Application metadata database — stores users, questions, dashboards, permissions, collections, and configuration

Both services connect over Railway's private internal network. PostgreSQL credentials are injected automatically. Metabase runs first-boot database migrations automatically — no manual setup required.


About Hosting Metabase

Running Metabase in production requires a persistent PostgreSQL database for application metadata, a public HTTPS endpoint for browser access and embedding, and a process that survives restarts without losing dashboard configuration. Without a managed host, you're setting up Docker, managing PostgreSQL, handling SSL, and configuring process restarts.

Railway provisions all of it. This template deploys Metabase pre-connected to Railway-managed PostgreSQL 17 over private networking. Dashboards, questions, users, and permissions survive every redeploy automatically.

Typical cost: ~$5–10/month on Railway's Hobby plan. Metabase Cloud Starter costs $85/month + $5/user — $110/month for 5 people, $135/month for 10. SSO, row-level security, and advanced embedding require Pro at $500/month + $10/user. Railway removes all of that.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — Metabase and PostgreSQL provision automatically
  2. Wait for first-boot database migrations to complete (~3–4 minutes after build)
  3. Open your Railway-assigned URL — the Metabase setup wizard loads
  4. Create your admin account and connect your first database via Admin → Databases
  5. Start building questions, dashboards, and alerts immediately

No SSH. No Docker configuration. No database setup.


Common Use Cases

  • Self-hosted BI platform without the $85/month Metabase Cloud bill — run the full Metabase feature set for your entire team at flat Railway compute cost with no user fees and no plan-based feature restrictions on the open-source edition
  • Self-hosted alternative to Tableau and Looker — Tableau costs $75/user/month, Looker requires enterprise contracts; Metabase gives non-technical teams drag-and-drop dashboards on the same data sources at a fraction of the cost
  • Startup analytics stack from day one — connect Metabase to your production PostgreSQL or MySQL database and give your whole team self-service access to revenue, retention, and product metrics without writing SQL or waiting for engineer time
  • Embedded analytics in your SaaS product — embed Metabase charts and dashboards in your application using iframes or JWT-signed embedding; iterate on analytics without deploying new frontend code
  • Customer-facing reporting — share public dashboard links or embed filtered views per customer without building a custom reporting layer from scratch
  • Scheduled reports and data alerts — set metric thresholds and receive Slack or email alerts when numbers move outside expected ranges; schedule weekly CSV or PDF reports to stakeholders automatically

Supported Databases

Connect any of these data sources via Admin → Databases after deploy:

CategoryDatabases
RelationalPostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle
Cloud WarehousesBigQuery, Snowflake, Amazon Redshift, Databricks
OtherMongoDB, Presto, Druid, Google Analytics, SparkSQL

Configuration

VariableRequiredDescription
MB_DB_TYPE✅ Pre-setpostgres — connects Metabase to the Railway PostgreSQL service
MB_DB_HOST✅ Auto-injectedPostgreSQL private hostname via Railway reference variable
MB_DB_PORT✅ Auto-injectedPostgreSQL port — defaults to 5432
MB_DB_DBNAME✅ Auto-injectedDatabase name via Railway reference variable
MB_DB_USER✅ Auto-injectedDatabase user via Railway reference variable
MB_DB_PASS✅ Auto-injectedDatabase password via Railway reference variable
MB_SITE_URLRecommendedYour Railway public domain — required for correct email links and embedding
MB_EMAIL_SMTP_HOSTOptionalSMTP host for alert and report emails
MB_EMAIL_SMTP_USERNAMEOptionalSMTP username
MB_EMAIL_SMTP_PASSWORDOptionalSMTP password
MB_ENCRYPTION_SECRET_KEYOptional16-char string — encrypts database credentials stored by Metabase

Metabase vs. BI Alternatives

Metabase (self-hosted)Metabase CloudTableauLooker
Monthly cost~$5–10 flatFrom $85/month$75/user/monthEnterprise contract
5-person team cost~$5–10/mo$110/month$375/monthCustom
No-code query builder✅ Yes✅ Yes✅ Yes⚠️ Limited
Full SQL editor✅ Yes✅ Yes⚠️ Limited✅ Yes
Embedded analytics✅ Open source✅ Yes✅ Yes✅ Yes
Data ownership✅ Your instance❌ Metabase servers❌ Tableau servers❌ Google servers
Self-hostable✅ Yes❌ No❌ No❌ No
Open source✅ AGPL-3.0❌ No❌ No❌ No
20+ database connectors✅ Yes✅ Yes✅ Yes✅ Yes

Dependencies for Metabase Hosting

  • Railway account — Hobby plan (~$5–10/month) covers Metabase and PostgreSQL
  • Your data source credentials — connect your production database, data warehouse, or any supported source via the Metabase admin panel after deploy

Deployment Dependencies

Implementation Details

Deploys metabase/metabase:latest alongside Railway-managed PostgreSQL 17 over private networking. All workspace data — dashboards, questions, users, and permissions — persists in PostgreSQL independently of the Metabase container. Redeploys and updates preserve everything. Set MB_SITE_URL to your Railway domain immediately after deploy — without it, email alert links and embedding URLs point to localhost. First-boot migrations run automatically in 2–3 minutes before the setup wizard appears.


Frequently Asked Questions

How much does self-hosted Metabase cost on Railway vs Metabase Cloud? The full stack runs at ~$5–10/month on Railway's Hobby plan with no user caps and no feature restrictions on the open-source edition. Metabase Cloud Starter costs $85/month plus $5/user — for a 5-person team that's $110/month, for 10 people it's $135/month. SSO, row-level security, and advanced embedding require the Pro plan at $500/month plus $10/user.

Which features are not available in the open-source edition? The Community Edition includes everything most teams need: no-code query builder, SQL editor, dashboards, alerts, scheduled reports, basic embedding, and 20+ database connectors. Features requiring a Pro license token: SSO/SAML, advanced row-level security, interactive embedding with JWT, audit logs, and priority support. These can be unlocked by adding a Pro license key — no migration needed.

Do I lose my dashboards and data if Railway redeploys? No. All dashboards, questions, collections, users, and permissions are stored in the Railway-managed PostgreSQL database — not inside the Metabase container. Redeploys and version updates do not affect your workspace data.

Can I connect BigQuery, Snowflake, or Redshift? Yes. After deploy, go to Admin → Databases → Add a database and select your source. Metabase's open-source edition supports BigQuery, Snowflake, Redshift, MongoDB, and 15+ other connectors out of the box — no additional licensing required.

How do I set up email alerts and scheduled reports? Set MB_EMAIL_SMTP_HOST, MB_EMAIL_SMTP_USERNAME, and MB_EMAIL_SMTP_PASSWORD in Railway Variables. On Railway's Hobby plan, raw SMTP is blocked — use Resend, SendGrid, or any API-based SMTP relay instead. Once configured, alerts and scheduled report emails work from the Metabase notification settings.

How do I upgrade Metabase? Update the image tag in Railway service settings (e.g. metabase/metabase:v0.52.0) and redeploy. Database migrations run automatically. Your workspace data is unaffected.


Why Deploy and Host Metabase on Railway?

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 on Railway, you get a production-ready business intelligence platform — dashboards, SQL editor, 20+ database connectors, alerts, and embedding — for your entire team at ~$5–10/month flat with no per-user fees and full ownership of your data and dashboards.


Template Content

More templates in this category

View Template
Matomo Analytics + MariaDB
Privacy-friendly analytics with MariaDB and persistent volumes.

leodev
View Template
Bugsink
Self-hosted Error Tracking. Sentry-SDK compatible

zǝʇɹoɔ oɓıɹpoɹ
View Template
SubTrackr
Self-hosted Subscription Tracker

amnesia