Self-hosting Metabase means running its open-source analytics server on your own machine. The quickest start is one Docker container; for real use you then move Metabase's own storage to PostgreSQL, connect your data source, put HTTPS in front and schedule backups. The first-run setup takes under an hour.
Short answer
Run the official Docker image (or the JAR), open the setup wizard on port 3000, and connect your database. For anything beyond a test, move Metabase's own application database 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 gives a team dashboards without paying per seat: its open-source edition is AGPL-licensed, so you run it on your own server with no licence fee. I lead open-source deployment work at MithTech, a team of Frappe specialists in Bengaluru, and we run self-hosted BI on top of ERPNext and other SQL databases. This is the production setup we use.
The docker run one-liner gets you a live dashboard in five minutes, but that default 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 BI tool that connects to your databases and lets non-technical users build charts, dashboards and alerts through a visual question builder, with a SQL editor for analysts. Its open-source edition is AGPL-licensed; Metabase, Inc. also sells Pro and Enterprise editions.
Self-hosting matters for three reasons: your data stays on your servers, which is often a compliance requirement; adding viewers costs nothing; and you control upgrades and integrations. In return you host, patch and secure the instance yourself. For the comparison with proprietary tools, see open-source Power BI and Tableau alternatives.
How do you install Metabase with Docker?
Metabase recommends Docker because the image bundles everything the server needs, and upgrades become a tag swap. With Docker running, pull and start the official image; within a minute the server listens on port 3000.
Start the container
Run the official image and map the port:
-d runs it in the background; -p 3000:3000 exposes the web UI.
Watch it boot
The first start takes a little while. Follow the logs until Metabase reports it is ready:
Open the setup wizard
Visit http://localhost:3000 (or the server's IP). Create the admin account, set your language, and you reach the empty Metabase home.
How do you run Metabase from the JAR?
Use the JAR when you cannot run Docker, for example on a locked-down VM. Metabase ships as a single Java archive that needs a Java runtime on the host. Its docs currently recommend version 25 of the Eclipse Temurin JRE and say earlier versions are not supported, so check the docs for the release you install.
Install Java
Install a supported JRE and confirm the version:
Run the JAR
Put metabase.jar in its own directory and start it:
Run it as a service
For a real deployment, wrap this in a systemd unit so Metabase restarts after a reboot or a crash, instead of stopping when you close the terminal.
The bare JAR also defaults to H2 storage, so the same production steps apply whichever install you pick.
How do you move Metabase off the H2 database?
This is the most important production step. H2 is a single file not meant for long-lived, concurrent use; it can corrupt under load and is awkward to back up cleanly. Tell Metabase to keep 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 the JAR:
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 documents a migration command that moves that content into PostgreSQL; copy the H2 file first. In Docker, keep the PostgreSQL data on a volume or a managed service so it survives container restarts.
How do you connect a database and build a dashboard?
Once Metabase runs, everything else happens in the browser. Its docs list official drivers for PostgreSQL, MySQL, MariaDB, SQL Server, BigQuery, Snowflake, ClickHouse and others, with community drivers for more. After you add a connection, Metabase scans the schema and you can start asking questions.
Add the data source
Go to Admin settings, Databases, 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 change 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 SQL editor for anything complex.
Save it to a dashboard
Save the question, choose a chart, then create a dashboard and add your saved questions. 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, so you can run owned analytics on an owned open-source ERP without a per-seat BI licence. Point it at a read replica if reports are heavy.
How do you secure a self-hosted Metabase?
The server speaks plain HTTP and does not manage TLS certificates, so exposing port 3000 to the internet is unsafe. Put a reverse proxy in front that terminates HTTPS, and tighten access 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 ones). Expose only ports 80 and 443; keep 3000 internal.
Lock down the network
Bind Metabase to localhost or a private network so it is reachable only through the proxy, and block the application port at the firewall.
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 business tables.
Give everyone their own account
Set a strong admin password, create per-user accounts rather than a shared login, and set up SSO where your edition supports it. Review permissions per collection.
How do you back up a self-hosted Metabase?
Back up the application database: the one store that holds every question, dashboard, collection and setting. Your business data source is backed up separately with its own tooling.
On PostgreSQL, schedule a regular pg_dump (or automated snapshots on a managed database) and keep 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 runs can be inconsistent. Either way, test a restore now and then. An untested backup is a guess.
Should you run Metabase yourself, or have it run for you?
Run it yourself if someone on your team will apply Metabase upgrades, keep Java and PostgreSQL current, and test a restore of the application database; it is then a fair way to self host Metabase with no licence fee. Have it run for you if nobody owns that work, because Metabase, its PostgreSQL database, a reverse proxy and backups add up to a small platform.
Do it yourself if
You have someone at home with Docker or systemd, PostgreSQL and Nginx or Caddy, a spare server to test restores on, and viewers who can wait a few hours if the dashboards are down.
Have it run for you if
Managers read these dashboards every day, the instance reaches your ERP or other business data, or nobody wants to read release notes and handle the Java version on each upgrade.
Under managed hosting we run Metabase on one named server in your cloud account or ours: nightly backups copied off it, one restored on a schedule, every upgrade tried on a copy first, and the keys stay yours. It is a monthly fee for running it plus the server, quoted in writing after a call; the self-hosting cost comparator sets that against a per-seat BI bill.
Frequently asked questions
+Is self-hosted Metabase really free?
Yes. The open-source edition is AGPL-licensed, with no per-user or per-server fee; you pay only for the server. Metabase also sells Pro and Enterprise editions with extra features; check its pricing page if you need those.
+Docker or JAR: which should I use?
Docker, for most teams: the image bundles the runtime, upgrades are a tag swap, and setup is the same on every machine. Use the JAR only when you cannot run containers; it needs Java 25 (per Metabase's current docs) and its own systemd service.
+Can Metabase connect to ERPNext?
Yes. ERPNext stores its data in MariaDB, and Metabase has a MariaDB driver, so you can point it at the ERPNext database (or a replica) with a read-only user and build dashboards on live data. Keep it read-only so the BI tool can never change 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 real use, move Metabase's application storage to PostgreSQL with the MB_DB_* variables, ideally before you build dashboards.
+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 migrations on boot. With the JAR, replace the file and restart the service. Back up the application database first and read the release notes for breaking changes, including the Java version.
+Is Metabase safe to expose to the internet?
Only after hardening. Metabase does not terminate HTTPS, so never expose port 3000 directly. Put it behind a reverse proxy with TLS, keep the application port private, use read-only database credentials, and give each person their own account.
Prefer to explore first? See the analytics and BI page and how we run open-source tools under managed hosting.
Comments & ratings
No comments yet. Start a new discussion.
Manoj · Published on 20 July 2026
Worked with us? Leave a Google review