Deploy Metabase | BI That Starts on 1 GB, Pinned, Private Postgres

Self-host Metabase on Railway — starts in 1 GB, pinned, private Postgres.

Deploy Metabase | BI That Starts on 1 GB, Pinned, Private Postgres

Just deployed

/var/lib/postgresql/data

Just deployed

Deploy and Host Metabase on Railway

Metabase, the open-source BI tool, self-hosted with its own Postgres for settings and dashboards. It starts within 1 GB of memory, the image is pinned, and the database is reachable only inside the project.

Nothing to fill in. Open the domain and Metabase's setup wizard creates the first admin account.

About Hosting Metabase

Two services:

  • Metabase v0.63.19.1: dashboards, questions and the admin panel (public)
  • Postgres 17: Metabase's application database, holding users, saved questions and dashboards, on its own volume and on the private network only

Connect the databases you want to analyse from Metabase's admin panel; they are separate from the Postgres that comes with this template.

Common Use Cases

  • Dashboards over your production database, shared with a team that does not write SQL.
  • Scheduled reports emailed or posted to Slack.
  • Self-service analytics where colleagues build their own questions with the visual query builder.

Dependencies for Metabase Hosting

Deployment Dependencies

  • Metabase metabase/metabase:v0.63.19.1 (public)
  • Postgres postgres:17.11-alpine
  • Metabase, AGPL-3.0. This template only configures the published image.

Implementation Details

  • The JVM is sized for the container. By default Java gives its heap a quarter of the container's memory. Under 1 GB that is about 250 MB, and Metabase dies on start with java.lang.OutOfMemoryError: Java heap space; raising the heap to three quarters fixes that but leaves no room for the rest of the JVM, and the kernel kills the process every half minute. JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=50 -XX:+UseSerialGC -XX:TieredStopAtLevel=1 gives the heap half, uses the single-threaded collector and the lighter JIT, and Metabase starts in 1 GB.
  • A longer health check window. On a single vCPU the first start, which also creates Metabase's schema, can take longer than the default five minutes; the window here is fifteen.
  • The image is pinned, rather than latest, so a redeploy does not upgrade Metabase and migrate its database without warning.
  • Postgres is private. No TCP proxy: only Metabase can reach its application database.

Configuration

The Postgres password is generated, and MB_SITE_URL follows the public domain. Metabase stays under 1 GB but needs nearly all of it; on a service limited to 0.5 GB it does not start.

To store database connection details encrypted, set MB_ENCRYPTION_SECRET_KEY to a random string of at least 16 characters before adding your first data source.

Verification

Deployed from this template into an empty project, both services starting at once: live in about a minute and a half, /api/health returns ok, and the setup wizard is waiting for the first admin. Built with Metabase capped at 1 GB and 1 vCPU, the first start with an empty database completed within the limit. The setup wizard was not completed during testing.

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

More templates in this category

View Template
NEW
Typesense PHP
official PHP client against Railway

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

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

leodev
1