Pro · Lesson 2 of 9

Installation and setup

Stand up Metabase Cloud or a self-hosted instance, and keep the application database separate from the warehouse.

Sign in to save your place.

Picture it this way

Installing Metabase is like setting up a reception desk. The desk has its own filing cabinet, which is the application database. The warehouse is the building next door. The desk can look things up in the warehouse. It does not become the warehouse.

Pick a home

Use Metabase Cloud when you want Metabase to run the servers. Use Docker or the JAR when the application must run in your network. Both speak to the same kinds of databases.

ChoiceYou operateGood fit
Metabase CloudUsers, connections, and contentMost teams
DockerThe container, the app database, and upgradesA network you control
JARA Java process plus the app databaseA simple single host

The environment variable MB_DB_TYPE chooses where Metabase stores its own data. Leave it unset only for a trial. H2 keeps that data in a local file, often metabase.db.mv.db. That file is easy to lose, and it is a poor fit for more than one application instance.

docker run -d -p 3000:3000 --name metabase \
  -e MB_DB_TYPE=postgres \
  -e MB_DB_DBNAME=metabase \
  -e MB_DB_PORT=5432 \
  -e MB_DB_USER=metabase \
  -e MB_DB_PASS=use-a-real-secret \
  -e MB_DB_HOST=metabase-db.internal \
  metabase/metabase

Do not point MB_DB at the warehouse

MB_DB_* is Metabase's notebook: users, questions, and dashboards. The warehouse connection is added later in the admin screen, with different credentials.

First admin and first connection

Open the site, create the first admin, and invite people by email instead of sharing that admin password. Then add a database. For PostgreSQL you need host, port, database name, user, and password. Use SSL when the host offers it. If the database is on a private network, the Metabase server must be able to open that port. Your laptop being able to connect does not mean the container can.

After the first sync, Metabase reads table and column names. You can hide technical columns, rename them for readers, and set a semantic type such as City or Email. That metadata lives in the application database. It does not alter the warehouse.

-- A warehouse user for charts. Run this on the warehouse, not on MB_DB.
CREATE ROLE metabase_reader LOGIN PASSWORD 'replace-me';
GRANT CONNECT ON DATABASE analytics TO metabase_reader;
GRANT USAGE ON SCHEMA public TO metabase_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO metabase_reader;

Two databases, on purpose

Metabase needs one database for its own settings and connects to another for your data.

  1. Application databaseUsers, questions, dashboards
  2. Metabase serverJAR or Docker container
  3. Your warehouseThe data you analyse

Step 1 of 3Metabase saves its users, questions and dashboards in an application database. Use PostgreSQL in production, not the default H2 file, which is easy to corrupt and lose.

MB_DB_TYPE=postgres
MB_DB_HOST=db.internal
MB_DB_DBNAME=metabase

Check the install

You are done with this lesson when an admin can sign in, a non-admin can sign in, and a sample question returns rows from the warehouse. If sync shows no tables, check the search path and the grants before you rebuild the container.

Knowledge check

What does MB_DB_TYPE choose?

Why avoid H2 for a real instance?

Which privilege does the warehouse user need?

Official sources

Checked against vendor documentation in October 2026. Screens and plan names still change, so confirm the control in your own instance.