Self-hosting Metabase means running the free, open-source analytics server on your own machine — the fastest path is a single Docker container, then you point it at a production database, connect your data source, and build dashboards. The whole first-run setup takes well under an hour.
Short answer
To self-host Metabase, run the official Docker image (or the Java JAR), open the setup wizard on port 3000, and connect your database. For anything beyond testing, move Metabase's own storage off the default H2 file onto PostgreSQL, put it behind HTTPS with a reverse proxy, and back up the application database on a schedule.
Metabase is one of the easiest ways to give a team dashboards without paying per seat — it is open source under the AGPL licence, so you can run it on your own server for free. I am Manoj, an open-source implementation consultant at Mith Tech in Bengaluru, and I deploy self-hosted BI stacks for Indian SMBs, usually on top of ERPNext and other SQL databases. This guide is the setup I actually run in production, not a copy of the marketing page.
The honest take: the docker run one-liner gets you a live dashboard in five minutes, but that default configuration is a demo, not a deployment — the real work is the database, HTTPS, and backups that come after.
What is Metabase and why self-host it?
Metabase is an open-source business-intelligence tool that connects to your databases and lets non-technical users build charts, dashboards, and alerts through a visual question builder, with a full SQL editor underneath for analysts. Released under the AGPL licence, the open-source edition is free to run on your own infrastructure with no per-seat fee.
Self-hosting matters for three reasons. Your data never leaves your servers, which is often a compliance requirement. There is no per-user subscription, so adding viewers costs nothing. And you keep full control of upgrades and integrations. The trade-off is real: you become responsible for hosting, patching, and securing the instance yourself. If you want the deeper comparison against proprietary tools, see my guide on the best open-source Power BI alternative.
Skimmable summary: Metabase is free, open-source BI; self-hosting keeps data in-house and removes per-seat fees in exchange for maintenance you own.
How do you install Metabase with Docker?
Docker is the method Metabase recommends, because the image bundles everything the server needs and upgrades become a matter of swapping the tag. Confirm Docker is installed and running, then pull and start the official image. Within a minute the server is listening on port 3000, ready for the browser-based setup wizard.
Start the container
Run the official image and map the port:
docker run -d -p 3000:3000 --name metabase metabase/metabase
The -d flag runs it in the background; -p 3000:3000 exposes the web UI.
Watch it boot
First start takes a short while as Metabase initialises. Follow the logs until you see it report readiness:
docker logs -f metabase
Open the setup wizard
Visit http://localhost:3000 (or your server's IP). Create the admin account, set your language, and you reach the empty Metabase home.
This is not production yet
The command above stores all of Metabase's own data in an embedded H2 file inside the container. Delete or recreate the container and that data is gone. Treat this as a working demo — the next section fixes it.
Skimmable summary: docker run -d -p 3000:3000 metabase/metabase gives a live server on port 3000, but the default H2 storage makes it a demo, not a deployment.
How do you run Metabase from the JAR instead?
Running the JAR is the alternative when you cannot use Docker — for example on a locked-down VM. Metabase ships as a single Java archive that needs a Java runtime on the host: Java 21 or higher, with Metabase currently recommending version 25 of the JRE from Eclipse Temurin. Download the open-source JAR, then launch it with one command.
Install Java
Install a supported JRE and confirm the version:
java -version
Run the JAR
Place metabase.jar in its own directory and start it:
java --add-opens java.base/java.nio=ALL-UNNAMED -jar metabase.jar
Run it as a service
For a real deployment, wrap this in a systemd unit so Metabase restarts on reboot and on crash, rather than dying when you close the terminal.
Like Docker, the bare JAR defaults to H2 storage. The same production hardening applies regardless of which install method you pick.
Skimmable summary: the JAR needs Java 21+ (Metabase recommends Java 21 from Temurin); run it with the documented --add-opens flag and manage it as a systemd service.
How do you move Metabase off the H2 database?
Migrating Metabase's application database is the single most important production step, because H2 is a single file never meant for concurrent, long-lived use — it corrupts under load and is painful to back up cleanly. The fix is to tell Metabase to store its own data in PostgreSQL instead, using environment variables read at startup.
Create an empty PostgreSQL database and pass these variables to the container or JAR:
| Variable | Purpose |
|---|---|
MB_DB_TYPE | Set to postgres |
MB_DB_DBNAME | Name of the empty Metabase database |
MB_DB_HOST | PostgreSQL host |
MB_DB_PORT | PostgreSQL port |
MB_DB_USER | Database user |
MB_DB_PASS | Database password |
Do this on a fresh instance before you build anything. If you already have dashboards on H2, Metabase provides a documented migration command to move that existing content into Postgres — always take a copy of the H2 file first. In Docker, remember to store the Postgres database on a volume or a managed service so it survives container restarts.
Keep the two databases separate
The application database (where Metabase stores dashboards) is different from the data source (the database you want to analyse). Point MB_DB_* at a database dedicated to Metabase — never at your production business data.
Skimmable summary: set the MB_DB_* environment variables to store Metabase's own data in PostgreSQL, ideally on a fresh instance, and never leave production content on the H2 file.
How do you connect a database and build a dashboard?
Connecting a data source is done entirely in the browser once Metabase is running. Metabase ships with drivers for the common SQL engines — PostgreSQL, MySQL/MariaDB, SQL Server, and more — plus others available as plugin drivers. After a connection is added, Metabase scans the schema and you can start asking questions immediately.
Add the data source
Go to Admin settings, then Databases, then Add database. Choose the engine, enter host, port, database name, and credentials, and save. Use a read-only database user so Metabase can query but never modify your data.
Ask a question
Click New, then Question. Pick a table and use the visual builder to filter, group, and summarise — no SQL needed. Analysts can switch to the native SQL editor for anything complex.
Save and add to a dashboard
Save the question, choose a visualization, then create a dashboard and drop your saved questions onto it. Add filters that apply across every card so viewers can slice the whole board at once.
If your data lives in ERPNext, Metabase reads its MariaDB tables directly — that pairing lets you build owned analytics on top of an owned open-source ERP without any per-seat BI licence.
Skimmable summary: add the database with a read-only user in Admin settings, build questions visually or in SQL, then arrange saved questions on a dashboard with shared filters.
How do you secure a self-hosted Metabase?
Securing Metabase starts with the fact that the server speaks plain HTTP and does not handle TLS certificates itself. Exposing it directly to the internet on port 3000 is unsafe. The standard pattern is a reverse proxy in front that terminates HTTPS, plus tightened access controls inside Metabase.
Put it behind a reverse proxy
Run Nginx, Caddy, or Traefik in front of Metabase to terminate HTTPS with a valid certificate. Let's Encrypt issues free certificates. Only expose ports 80 and 443 publicly; keep 3000 internal.
Lock down the network
Bind Metabase to localhost or a private network so it is only reachable through the proxy. Use a firewall to block direct access to the application port from outside.
Use read-only data users
Give Metabase database credentials that can only read. A compromised dashboard tool should never be able to write to or drop your business tables.
Enforce strong accounts
Set a strong admin password, add per-user accounts rather than sharing one login, and configure SSO or session controls where available. Review the Admin permissions per collection.
Skimmable summary: terminate HTTPS with a reverse proxy, keep port 3000 private behind a firewall, use read-only database credentials, and give every person their own account.
How do you back up a self-hosted Metabase?
Backing up Metabase means backing up its application database — the one SQL store that holds every question, dashboard, collection, and setting. Backups of your business data source are separate and handled by that database's own tooling. Your strategy depends on where Metabase stores its data.
If you followed the production advice and use PostgreSQL, back it up with standard PostgreSQL tooling — schedule a regular pg_dump (or enable automated snapshots on a managed database) and store the dumps off the server. If you are still on H2, stop Metabase, copy the metabase.db.mv.db file to safe storage, and restart; a copy taken while the server is running can be inconsistent. Either way, test a restore occasionally — an untested backup is a guess.
Hosting the whole stack
Running Metabase, its Postgres database, a reverse proxy, and backups is a small platform in itself. If you would rather not own that, a managed platform-as-a-service setup can host it for you — see how we approach PaaS deployments.
Skimmable summary: back up Metabase's application database — pg_dump on a schedule for Postgres, or copy the metabase.db.mv.db file with the server stopped for H2 — and test the restore.
Frequently asked questions
Is self-hosted Metabase really free?
Yes. The open-source edition of Metabase is free under the AGPL licence, with no per-user or per-server fee — you only pay for the server you run it on. Metabase also sells paid Pro and Enterprise editions with extra features; pricing varies by edition, so check the vendor's official page if you need those.
Docker or JAR — which should I use to self-host Metabase?
Metabase recommends Docker, and so do I for most teams: the image bundles the runtime, upgrades are a tag swap, and the setup is consistent across machines. Choose the JAR only when you cannot run containers — it needs a Java 21+ runtime (Metabase currently recommends Java 21 from Eclipse Temurin) and its own systemd service.
Can Metabase connect to ERPNext?
Yes. ERPNext stores its data in MariaDB, and Metabase has a native MySQL/MariaDB driver, so you can point Metabase at the ERPNext database with a read-only user and build dashboards on your live business data. Keep it read-only so the BI tool can never modify ERP records.
Do I need PostgreSQL to run Metabase?
Not to start — Metabase runs out of the box on an embedded H2 file. But H2 is only for testing. For any real use you should move Metabase's own application storage to PostgreSQL using the MB_DB_* environment variables, ideally before you build dashboards, because H2 is fragile under concurrent load.
How do I upgrade a self-hosted Metabase?
With Docker, stop the container, pull the newer image tag, and start a new container pointed at the same application database — Metabase runs any needed migrations on boot. With the JAR, replace the file and restart the service. Always back up the application database before upgrading, and read the release notes for breaking changes.
Is Metabase secure enough to expose to the internet?
Only after hardening. Metabase itself does not terminate HTTPS, so never expose port 3000 directly. Put it behind a reverse proxy with TLS, keep the application port on a private network, use read-only database credentials, and give each user their own account. With those in place it is safe to reach over the public internet.
About the author
I am Manoj, an open-source implementation consultant at Mith Tech in Bengaluru. I deploy and maintain self-hosted BI and ERP stacks for Indian SMBs — most often Metabase and Apache Superset on top of ERPNext and other SQL databases. This guide reflects the production setup I run for clients, not a repackaged install page.
Want Metabase set up and maintained for you?
Prefer to explore first? See our Metabase implementation service and how we host open-source tools as a managed platform.