Deploy Metabase Interactive Embed
interactive embed for SaaS products
Just deployed
/var/lib/postgresql/data
metabase/metabase
Just deployed
Deploy and Host self hosted Metabase Interactive Embed (Open-Source BI) on Railway
Interactive embed puts the full Metabase UI inside an iframe in your SaaS app, so users never leave your product.
About Hosting Metabase Interactive Embed open-source software on Railway (self hosted Metabase template)
I configured my first Metabase embed backwards. Dashboard built, sharing enabled, iframe pasted into a test page — it rendered beautifully for ten minutes. Then I redeployed and every embed broke.
On Railway, Metabase runs as a Docker service next to Postgres. The official metabase/metabase image boots on port 3000, runs migrations against Postgres on first launch, and hands you the setup wizard.
The self-hosted template is deliberately minimal: one Metabase service, one Postgres service, no multi-node clustering.
Why Deploy Metabase Interactive Embed, the Tableau alternative on Railway (Railway Free Trial)
Tableau Embedded assumes you already bought Tableau.
Developer experience is the other reason. Metabase speaks SQL natively, lets you write questions in the query builder or raw SQL, and exposes dashboards through a straightforward embed API.
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 Interactive Embed 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 Interactive Embed self hosting
Self-hosting Metabase for embeds means owning uptime, backups, and that encryption secret. A raw VPS gives you root access and nothing else — you hand-roll Docker, reverse proxies, TLS, and Postgres replication.
| Provider | Embed Production Fit | Secret & URL Management | Cost Profile |
|---|---|---|---|
| DigitalOcean | Manual Droplet or App Platform; you manage TLS, Postgres, redeploys | Env vars via control panel, secret rotation manual | Predictable per-droplet pricing; labor not included |
| AWS | ECS + RDS is the "right" way but a full-time setup; overkill for single-node Metabase | Parameter Store or Secrets Manager required | Metered complexity; costs spiral with idle resources |
| Hetzner | Cheap, reliable, but you own nginx to backups | Nothing managed; script env var persistence | Lowest raw compute cost; highest operational overhead |
Common Use Cases for hosted Metabase Interactive Embed
The classic case is B2B SaaS showing each customer their own usage analytics. Your app knows who the user is; you embed a Metabase dashboard filtered to that customer’s ID and let them drill into their data.
Another pattern is internal portals for agencies or consultancies. You build one Metabase instance, create a dashboard per client, and embed those dashboards in a client portal with signed parameters scoping the data.
Startup founders also use Metabase embeds as their entire customer analytics layer.
Dependencies for Metabase Interactive Embed Docker hosted on Railway
The dependency graph is small but ordered.
Core dependencies: the metabase/metabase Docker image (pin a version like v0.63.x rather than floating on latest), a Postgres 17 instance via ghcr.io/railwayapp-templates/postgres-ssl for the app database, and environment variables wiring them together.
Deployment Dependencies for Managed Metabase Interactive Embed Service (Embedded Analytics)
For embedded analytics specifically, five variables must be set before the first real embed goes out.
Then there’s MB_ENCRYPTION_SECRET_KEY. Metabase encrypts sensitive settings — database passwords, embed signing keys, SSO secrets — with this key. If it changes between deploys, every encrypted value becomes unreadable.
Finally, MB_SITE_URL must be the public HTTPS URL of your Metabase instance. Embed iframes, password reset links, and email links all get built from this value. Wrong or default localhost means embeds point at a URL that doesn’t resolve from customers’ browsers.
Implementation Details for Metabase Interactive Embed (Using Metabase official docker image)
Pull metabase/metabase and expose port 3000 — the UI port. The health check is a GET to /api/health, which returns JSON when the app is up. Railway uses that health check to decide when the deploy is live, so don’t skip it.
On first boot, Metabase runs migrations against the Postgres app database, creating tables that store questions, dashboards, permissions, and embed configurations.
After the admin exists, connect analytics databases through Admin → Databases. These are separate from the app database.
How does Metabase Interactive Embed compare against other interactive embedded analytics platforms
Metabase Interactive Embed places the full query builder and dashboard UI in an iframe inside your SaaS product. It suits product teams shipping customer-facing analytics. Comparisons below.
Metabase Interactive Embed vs Tableau Embedded (Tableau Embedded Alternative)
Tableau Embedded offers deep visual exploration but is heavier to license and embed. Metabase Interactive Embed is lighter, SQL-friendly, and faster for SaaS customer embeds with SSO/JWT.
Metabase Interactive Embed vs Looker Embedded (Looker Embedded Alternative)
Looker Embedded uses LookML modeling and costs more. Metabase Interactive Embed skips a modeling layer, embeds the full UI in an iframe, and supports row-level permissions via Pro/SSO.
Metabase Interactive Embed vs Power BI Embedded (Power BI Embedded Alternative)
Power BI Embedded is Azure-tied and per-session priced. Metabase Interactive Embed is open-core, self-hostable, and simpler for SaaS iframe embedding with Postgres-backed app DB.
Metabase Interactive Embed vs ThoughtSpot (ThoughtSpot Alternative)
ThoughtSpot targets search-driven analytics at enterprise scale. Metabase Interactive Embed is lighter, cheaper, and easier to self host on Railway for interactive SaaS embeds.
How to use Metabase Interactive Embed (the OSS Embedded Analytics)?
OSS Metabase supports static embeds only: prebuilt dashboards or questions rendered in an iframe with locked parameters. Interactive embed requires Pro/Enterprise, enabling full UI, SSO/JWT, and row-level permissions. Set MB_SITE_URL to your app origin, configure JWT SSO in admin settings, then iframe Metabase URLs with signed tokens.
How to self host Metabase Interactive Embed on other VPS Services (Metabase Interactive Embed self hosting guide)
You can run Metabase OSS on any VPS with Docker or JAR. Interactive embed features need a Pro license key added in admin settings. Steps below.
Clone the Repository
Use the official Metabase Docker image or clone the metabase/metabase repo. For Railway, clone your own fork only if modifying the image.
Install Dependencies
Use Docker: docker run -d -p 3000:3000 metabase/metabase. Or install Java 11+ and run java -jar metabase.jar.
Configure Environment Variables
Set MB_DB_TYPE=postgres, MB_DB_HOST, MB_DB_PORT, MB_DB_DBNAME, MB_DB_USER, MB_DB_PASS, MB_ENCRYPTION_SECRET_KEY, MB_SITE_URL. Use Postgres not H2.
Start the Metabase Interactive Embed Application
Run the container or JAR, wait for /api/health to return 200, open port 3000, then complete setup and add Pro license.
Official Pricing of Metabase Interactive Embed (Metabase Interactive Embed pricing)
Metabase OSS is AGPL and free to self host, but interactive embed and SSO/JWT require Pro or Enterprise. Metabase Cloud Starter begins around $85/mo. Self hosting on Railway usually $5–15/mo plus Metabase Pro license cost if you need interactive embed.
Metabase Interactive Embed cloud vs self hosted comparison (Pricing, features, costs, and more)
Cloud manages upgrades, backups, and HTTPS. Self hosting on Railway gives full control and lower infra cost, but you manage Metabase, Postgres, and Pro license. Both support interactive embed when Pro is enabled.
Monthly cost of self hosting Metabase Interactive Embed on Railway
Railway Metabase + Postgres typically $5–15/mo on Hobby. Add Metabase Pro license cost (separate). Static OSS embeds cost only Railway usage.
System Requirements for Hosting Metabase Interactive Embed on a VPS
Minimum: 1 vCPU, 1–2 GB RAM, 10 GB disk for small embeds. Postgres needs 256 MB+ RAM. Use 2 vCPU/4 GB for many concurrent iframe sessions.
Frequently Asked Questions (FAQs)
Common setup and cost questions for interactive embedding on Railway and VPS.
Can I do customer embeds on Metabase OSS?
No interactive customer embeds. OSS supports static dashboard/question embeds with locked filters, no SSO/JWT or per-user row controls.
What is MB_SITE_URL used for with embeds?
It sets the canonical origin for generated iframe URLs and JWT SSO redirects. Must match your SaaS app domain or tokens fail.
Why must the app DB be Postgres not H2?
H2 is file-based and single-process; it breaks on Railway restarts and blocks multi-instance embeds. Postgres persists and supports concurrent sessions.
What breaks if I rotate MB_ENCRYPTION_SECRET_KEY?
Existing embed tokens, SSO sessions, and dashboard subscription settings become invalid. Rotate only with planned re-login and re-embed.
How does Railway cost compare to Metabase Cloud?
Railway Metabase+Postgres $5–15/mo vs Cloud Starter ~$85/mo. But Cloud includes Pro interactive embed and managed hosting; self-host adds Pro license.
Is this template multi-node HA?
No. This template runs one Metabase instance and one Postgres. For HA, add replicas, external Postgres, and shared encryption secret. Keep the Metabase Postgres app DB and a stable encryption secret; the UI listens on port 3000 with health at /api/health so restarts stay clean.
Template Content
metabase/metabase
metabase/metabase