Deploy Metabase Models

curated models on top of raw tables

Deploy Metabase Models

metabase/metabase

metabase/metabase

Just deployed

/var/lib/postgresql/data

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

Two dashboards show different revenue because a raw join forgot to filter refunds. Metabase Models stops that: curated, analyst-owned datasets between raw tables and every dashboard. Here's how to host it on Railway.

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

Metabase Models isn't a separate download; it's the Models feature inside Metabase OSS, AGPL-licensed BI. A Model is a saved query with a name, description, typed columns, and cached results.

Self-hosting matters because Models shine when you control warehouse connections, caching, and permissions. Railway gives that without VPS babysitting: one Metabase container plus one Postgres for the app DB.

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

Tableau makes pretty charts, but data prep lives in Prep, published sources, and tribal memory. Metabase Models flips that: write a query once, save as a Model, everyone downstream queries it. Change the schema and you update one model, not forty dashboards.

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 Models 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 Models self hosting

ProviderSetup pathOngoing opsCost profile
DigitalOceanDroplet + manual DockerYou own updates, backups, firewallsPredictable but fully DIY
AWSEC2 + RDS + security groups + IAMHighest ops surface for one BI containerMetered, RDS costs add up
HetznerBare VPS + Docker composeCheap but all manual, EU datacentersLowest raw price, highest effort
RailwayContainer + managed Postgres in one projectRailway handles restarts, TLS, deploysPay-as-you-go, ~$5–15/mo small stack

Railway doesn't give you a pet server to SSH into; for custom kernel tweaks or nginx Lua, a raw VPS wins. For most teams, not thinking about the OS is the point.

Common Use Cases for hosted Metabase Models

  • Standardized metrics. Encode refunds and discounts once in a Model; every dashboard queries it.
  • Onboarding analysts. Hand new hires five models (orders, customers, revenue, churn, spend) and skip warehouse archaeology.
  • Embedded analytics. Customers query curated models, not raw tables; change SQL underneath without breaking saved questions.
  • Warehouse migration. Point models at the new warehouse, keep names; downstream dashboards don't care.
  • Caching hot datasets. A 45-second Snowflake query marked as a Model serves 20 viewers in under a second; the warehouse runs it once.

Dependencies for Metabase Models Docker hosted on Railway

Metabase needs two database roles: the app DB stores users, dashboards, saved questions, and model definitions. Analytics databases are what you query. Confusing these wipes Metabase on redeploy, because the app DB is not a warehouse.

Deployment Dependencies for Managed Metabase Models Service (Business Intelligence)

Postgres for the app DB is non-negotiable. Embedded H2 lives in the container filesystem; redeploy and users, dashboards, model definitions vanish. Use companion Postgres (ghcr.io/railwayapp-templates/postgres-ssl, v17 works).

Implementation Details for Metabase Models (Using Metabase official docker image)

Set these on the Metabase service in Railway:

  • MB_DB_TYPE=postgres
  • MB_DB_HOST, MB_DB_PORT, MB_DB_USER, MB_DB_PASS, MB_DB_DBNAME — point at companion Postgres; Railway internal networking uses the service name as hostname.
  • MB_ENCRYPTION_SECRET_KEY — a long random string, never change it. It encrypts DB credentials; rotate and every warehouse breaks.
  • MB_SITE_URL — set to the public HTTPS URL for links, embeds, password resets.

First boot migrates app Postgres and opens the setup wizard for the admin user. Then connect warehouses via Admin → Databases (Postgres, MySQL, BigQuery, Snowflake, Redshift, MongoDB, etc.). Those are separate from the app DB and are not created by this template.

How does Metabase Models compare against other semantic / modeled BI platforms

The space is crowded, and each tool bets differently. Metabase Models is lightweight and SQL-first; others add governance or abstraction.

Metabase Models vs Looker (Looker Alternative)

Looker's LookML is a full modeling language with version control and a steep curve. Metabase Models is a saved query with a name. Looker wins with a dedicated analytics engineering team and field-level access control.

Metabase Models vs Cube (Cube Alternative)

Cube is a headless semantic layer serving any frontend; Metabase Models only serves Metabase. If five tools need one metric definition, Cube is right. If your BI stack is Metabase, Models gives 80% of the value with zero extra infrastructure.

Metabase Models vs Lightdash (Lightdash Alternative)

Lightdash is dbt-native; your dbt models become BI entities automatically. Metabase Models doesn't know dbt exists. With a mature dbt project, Lightdash is compelling. Without dbt and CLI comfort, Metabase is friendlier.

Metabase Models vs dbt Semantic Layer (dbt Semantic Layer Alternative)

dbt Semantic Layer with MetricFlow defines metrics once in YAML and generates SQL for any tool. Metabase Models stores SQL, not generates it. For governed metrics with lineage, dbt wins. For exploratory speed, Models is faster.

How to use Metabase Models (the OSS Business Intelligence)?

After setup, connect a warehouse in Admin → Databases. In the query builder, write SQL or use the notebook editor, then Save → Save as model. Name it, add a description of what's included/excluded, set column types — the description self-documents.

Business users see Models in the data picker alongside raw tables and build questions the same way, but joins and filters are baked in. Edit the model's SQL and everyone downstream sees the new definition.

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

Railway is easiest, but the stack works on any VPS with Docker. Here's the manual route.

Clone the Repository

Metabase doesn't require a repo — it's a Docker image. For config as code, create a repo with docker-compose.yml and env file as source of truth.

Install Dependencies

Install Docker and Docker Compose on the VPS. Pull metabase/metabase:v0.63.x and postgres:17. Metabase bundles its own JVM and web server, so no separate Java install.

Configure Environment Variables

Create a .env with the same variables: MB_DB_TYPE, MB_DB_HOST, MB_DB_PORT, MB_DB_USER, MB_DB_PASS, MB_DB_DBNAME, MB_ENCRYPTION_SECRET_KEY, MB_SITE_URL. Point MB_DB_HOST at the Postgres container name.

Start the Metabase Models Application

Run docker compose up -d. Metabase starts on port 3000, migrates Postgres, shows setup wizard. Forward port 3000 through firewall or reverse proxy. You own backups, certs, kernel updates.

Official Pricing of Metabase Models (Metabase Models pricing)

Metabase OSS, including Models, is free under AGPL. Run, modify, embed internally without paying Metabase. AGPL matters for commercial SaaS embedding: release source or buy a commercial license.

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

Self-hosted OSS includes Models, query builder, dashboards, email subscriptions, basic permissions. You lose SSO beyond LDAP/Google, row-level security, some embedding polish.

Monthly cost of self hosting Metabase Models on Railway

You pay Railway compute plus companion Postgres. A small stack — Metabase with 1GB RAM plus basic Postgres — typically lands around $5–15/month on Hobby, depending on usage and trial window. No per-user fees; twenty analysts cost the same as two.

System Requirements for Hosting Metabase Models on a VPS

Metabase is a JVM app: 2GB RAM comfortable for small teams, 4GB for heavy caching or concurrency. One or two CPU cores is fine. Postgres needs 1GB RAM and a few gigs disk; disk matters for cached model results on large datasets.

Frequently Asked Questions (FAQs)

Can I use Metabase Models without a separate Postgres?

Technically yes with embedded H2, but it's a trap: H2 lives in the container, so redeploy erases models, users, dashboards. Use Postgres.

Do Models replace raw tables?

No. Models sit on top of raw tables. Business users see both in the data picker, so Models are a curated path, not a locked door. True lockdown needs Pro/Enterprise permissions.

How do I change a Model without breaking dashboards?

Edit the SQL in place. Keep output column names and types; downstream questions keep working. Rename a column and things break — version by adding columns, not renaming.

Does caching a Model mean stale data?

Yes, by design. You set TTL. A 10-minute cache can be 10 minutes stale. For real-time, query raw table or set cache to zero. Manual refresh is in admin panel.

Can I connect Metabase Models to multiple warehouses?

Yes. App DB is one Postgres; connect many analytics databases (Postgres, Snowflake, BigQuery, Redshift, MySQL, MongoDB). Models reference any connected DB; cross-warehouse joins need a federated engine.

Is the single-node Metabase setup on Railway highly available?

No, honestly. One Metabase container plus one Postgres; Railway restarts crashes, but brief downtime. True HA needs multiple nodes behind a load balancer sharing Postgres — outside this template.


Template Content

More templates in this category

View Template
NEW
Formbricks | Open-Source Typeform & Qualtrics Alternative
Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Two Workspaces
2
View Template
Typesense PHP
official PHP client against Railway

onepush
0
View Template
Typesense vs Meilisearch
self-hosted Typesense vs Meilisearch

onepush
0