Pro · Lesson 2 of 9
Stand up Metabase Cloud or a self-hosted instance, and keep the application database separate from the warehouse.
Sign in to save your place.
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.
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.
| Choice | You operate | Good fit |
|---|---|---|
| Metabase Cloud | Users, connections, and content | Most teams |
| Docker | The container, the app database, and upgrades | A network you control |
| JAR | A Java process plus the app database | A 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/metabaseMB_DB_* is Metabase's notebook: users, questions, and dashboards. The warehouse connection is added later in the admin screen, with different credentials.
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;Metabase needs one database for its own settings and connects to another for your data.
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
Step 2 of 3The Metabase server reads those settings when it starts.
docker run -d -p 3000:3000 --env-file metabase.env metabase/metabase
Step 3 of 3Your data lives in a separate database that you add under Admin → Databases, ideally with a read-only user.
CREATE USER metabase_ro WITH PASSWORD '...';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO metabase_ro;
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.
Checked against vendor documentation in October 2026. Screens and plan names still change, so confirm the control in your own instance.