Deploy Metabase
Open-source BI: dashboards, charts and SQL, with Postgres as app database
Metabase
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host Metabase on Railway
Metabase is an open-source business intelligence tool. You connect it to your databases, then ask questions with a point-and-click editor or SQL, build charts and dashboards, and share them with your team. It runs as a single Java application and stores its own users, questions and dashboards in an application database.
About Hosting Metabase
Metabase ships as one official Docker image. Out of the box it keeps its application data in an embedded H2 file, which Metabase itself does not recommend for production because the file can be corrupted on restarts and is hard to back up. This template runs the official image pinned to v0.65.4.1 and connects it to a Railway PostgreSQL service as the application database, wired over the private network. It generates the encryption key for saved database credentials and the session signing key, sets the site URL to your Railway domain, caps the Java heap at 2 GB, and uses Metabase's /api/health endpoint as the health check. The first start runs database migrations and takes about a minute.
Common Use Cases
- Build dashboards and reports on top of your production or analytics databases
- Let non-technical teammates explore data with the visual query builder instead of SQL
- Share charts, embed dashboards and schedule email or Slack summaries
Dependencies for Metabase Hosting
- PostgreSQL (Railway's PostgreSQL service, included) as the application database
- The official
metabase/metabaseDocker image
Deployment Dependencies
- Metabase Docker image: https://hub.docker.com/r/metabase/metabase
- Running Metabase on Docker: https://www.metabase.com/docs/latest/installation-and-operation/running-metabase-on-docker
- Migrating away from H2 and supported application databases: https://www.metabase.com/docs/latest/installation-and-operation/configuring-application-database
- Environment variables reference: https://www.metabase.com/docs/latest/configuring-metabase/environment-variables
- Releases: https://github.com/metabase/metabase/releases
Implementation Details
The Metabase service runs the official image metabase/metabase:v0.65.4.1 (pinned by digest) with this start command, which sets fixed defaults and then runs the image's own entrypoint:
/bin/sh -c 'export MB_DB_TYPE="${MB_DB_TYPE:-postgres}" MB_JETTY_PORT="${PORT:-3000}" JAVA_OPTS="${JAVA_OPTS:--Xmx2g}"; exec /app/run_metabase.sh'
- Open your Railway domain after the deploy finishes and complete the setup wizard. The first account you create becomes the admin. Until you finish setup, anyone who knows the URL can open the wizard, so do it right away.
MB_ENCRYPTION_SECRET_KEYencrypts the connection details of databases you add. Keep it and don't change it, or Metabase can no longer read those saved connections.MB_SESSION_SECRET_KEYsigns login sessions. Changing it logs everyone out.- To give Metabase more or less memory, set a
JAVA_OPTSvariable on the Metabase service, for example-Xmx1gor-Xmx4g. - All questions, dashboards and users live in the Postgres service, which has its own volume. Back up that database to back up Metabase.
- To upgrade, change the image tag to a newer Metabase release. Metabase migrates the application database on start, so back up Postgres first.
Why Deploy 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 are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content

