Troubleshooting Metabase on Docker

A practical guide to diagnosing containerized Metabase failures: exits, remote database connections, lost application data, port mapping and file permissions. It also explains when to bring in a partner.

On this page

Why Metabase on Docker fails and where to start troubleshooting

Most Metabase on Docker failures trace back to a small set of container settings: the environment variables that point Metabase at its application database, the port mapping between host and container, the volume that holds application data, and the user the process runs as. Start there before you change anything inside the application. Metabase runs as a Java JAR inside the container, so the container itself must start the JAR with a working Java runtime, reach a database, and write to a path it owns. When a container exits immediately, the logs from docker logs usually name the failing setting within a few lines.

Keep two databases separate in your head. The application database stores Metabase's own state: users, groups, saved questions, dashboards, permissions and settings. A data source is a database Metabase queries on behalf of analysts. Container problems in the first category lose or block Metabase's own content, while problems in the second category only break individual charts and sync. Metabase ships with an embedded H2 application database for demos, and its documentation recommends PostgreSQL for production. If dashboards disappear after a restart, check first whether the application database lives inside the container without a persistent volume. The open source license (AGPL) governs how you may use and modify the code, but it does not change any of these fixes.

Decide early whether your own team can work through these failures. In-house staff who run containers daily can usually resolve startup, networking and volume issues from the logs and configuration. Bring in a partner when the failure involves data you cannot afford to lose, when a restore or migration off H2 is needed, or when the same fault returns after a fix. Confirm the exact image tag, Metabase version and Docker host details from your own environment before you act, because the troubleshooting guide and version support page are the authoritative references for your release.

Matching symptoms to the likely cause

When the container starts and stops again within seconds, the process inside has failed before the web server came up. The most common causes are a missing or malformed environment variable, an application database setting that points at something the container cannot reach, or a host that has run out of memory for the JVM. The container logs record the reason for the exit, so read them before you change anything. Work through the following checks in order.

  • Read the last lines of the container log: Use docker logs on the stopped container and look for the final error before the exit, not the first warning.
  • Check the exit code and restart policy: Run docker inspect on the container and confirm the recorded exit state and whether a restart policy is re-launching it in a loop.
  • Review the environment variables: Compare the variables passed with -e or in your Compose file against the names in the Metabase documentation, and look for typos, stray quotes or unset variables.
  • Confirm the application database settings: If Metabase is pointed at PostgreSQL or MySQL, a failed connection at startup will stop the container, so verify those variables against the configuring the application database guide.
  • Check host memory: If the log ends without an application error, the host may have terminated the process, so confirm available memory and any memory limit set on the container.

After the log points to a cause, correct that single setting and start the container again before changing anything else.

How to diagnose a failing Metabase container step by step

This sequence moves from the cheapest evidence to the most involved checks, so you can find where a failing Metabase container breaks before changing configuration. Each step ends with a result that tells you whether to continue or stop.

  1. Read the container logs and exit code

    Start by capturing the container's exit code and the last several hundred lines of its logs, using the container runtime's status and log commands with the container name or ID. Look for the first error rather than the last one, because later errors are often consequences of the first. Note whether the container exited immediately, restarted in a loop, or is still running but unreachable. If the logs show a clear startup error, such as a failed database connection or a missing environment variable, record it and continue to the next step. If the container is running and the logs are clean, skip ahead to the port mapping and network checks.

  2. Confirm the image tag and environment variables

    Compare the image tag you deployed with the release you intended, and list the environment variables the container actually received using the runtime's inspect command. Check the application database settings, the encryption key if you set one, and the site URL. Mistakes here often show up as a container that starts and then stops, or as a dashboard that loads with the wrong address. Confirm that any variable containing a secret came from your secret store and is not written in plain text in a shared file. Continue when the tag matches your plan and every required variable is present with the expected format. Stop and correct the file if a variable is missing or misspelled, then redeploy the container.

  3. Verify the application database host resolves

    Open a shell in the running container and test whether the application database host name resolves and accepts a connection on the database port. Inside Docker, Metabase reaches the application database from within the container, so the host name must be a fully qualified hostname that the container can resolve, or you must add a proper entry in the container's hosts file. A short name that works on the host machine often fails inside the container. Confirm the resolution result and the port response before going further. If the name does not resolve, fix DNS or the hosts entry and restart the container. If it resolves and the port answers, continue to the network reachability step.

  4. Check network reachability to the database

    If name resolution works but the connection still fails, test the route from the container to the database host and port, and confirm that no firewall, security group or network policy blocks the path. Run the test from inside the container's network namespace, not only from the host, because the container may use a different bridge or network than the host. Check that the database accepts connections from the container's source address, which is often different from the host's address. Record which test passed and which failed. If the route is open and the database accepts the connection, continue. If the route is blocked, stop and involve the team that owns the network or database access rules.

  5. Confirm volume mounts and data persistence

    Inspect the container's mounts and confirm that the data directory Metabase uses for application data is backed by a named volume or a host path that you chose on purpose. If the container writes to its own filesystem, application data disappears when the container is recreated, which looks like lost users or dashboards after an update. Also check the ownership and permissions of any host directory mounted into the container, because the process inside the container must be able to read and write it. Permission errors usually appear in the logs as write or access denied messages. Continue when the mount is present, persistent and writable by the container process. Stop and correct the mount or ownership if either check fails.

  6. Verify host port mapping and the reverse proxy

    Confirm that the port the container listens on is published to the host port you expect, and test the published port from the host and from a client on the same network as your users. A mapping that exists but points to the wrong container port, or a host port already used by another service, will look like an application failure. If you place a reverse proxy in front of Metabase, check that it forwards to the published host and port and that the site URL setting matches the address users type. Continue when a request to the published port returns the Metabase sign-in page. If it does not, correct the mapping or proxy target and test again.

  7. Record findings and decide the next action

    Write down the first failing check, the evidence you collected, and the change you made, so that the fix can be reviewed and repeated on another environment. If every step passed and the container still fails, capture the full logs, the exact image tag and the configuration with secrets removed, then engage the vendor documentation or your support channel before making further changes. Confirm the outcome by signing in to Metabase from a client on the expected network and checking that a saved question loads against the application database. Keep this record with your change tickets, because it is the fastest way to explain the incident later.

Application database options for Docker deployments

This table compares the three application database choices for a containerized Metabase: embedded H2, PostgreSQL and MySQL or MariaDB. Read each row against your environment, since the container failure modes differ by option. The main takeaway is that H2 suits demos only, and any move off H2 must use the load-from-h2 command with the matching Metabase version.

OptionWhen it fitsWhat breaks in a container if misconfiguredWhat to confirm before choosing
Embedded H2Demos and short evaluations only, where losing data is acceptableThe H2 file sits inside the container unless a volume is mounted, so a container replacement can discard all application dataWhether a volume maps the data directory and whether the instance will ever move to a production database
PostgreSQLProduction, and the database Metabase recommends for productionMetabase cannot reach a host named only by a short container name, so it needs a fully qualified hostname or a proper hosts entryHostname resolution from the Metabase container, credentials, network path and the backup owner
MySQL 8.4.0 or laterProduction where MySQL is the standard database serviceCharacter set problems if the database is not created with utf8mb4, plus the same hostname and network issues as PostgreSQLServer version, utf8mb4 character set and collation, and that the database is created before first start
MariaDB 10.6.0 or laterProduction where MariaDB is the standard database serviceSame utf8mb4 and hostname issues as MySQL, and failed startups when the server version is older than the minimumServer version meets the minimum, utf8mb4 is configured, and the team can back up and restore it
Moving from H2 to PostgreSQL or MySQLWhen an H2 instance must become production without losing contentRunning load-from-h2 with a different Metabase version than the one that last wrote the H2 file can fail or corrupt the moveThe exact Metabase version that last updated the H2 file, a copy of that file, and a tested restore plan

Why a remote application database fails from inside the container

A container resolves hostnames in its own network namespace, so a database name that works on the Docker host can fail inside the Metabase container. The Metabase Docker documentation makes this point directly: from inside the container, Metabase connects to its application database over the network, so it needs a fully qualified hostname or a proper /etc/hosts entry. A short name like postgres may resolve through the host's search domains, while the container uses its own resolver configuration and sees nothing. Check this first by running a lookup from inside the running container (for example, with docker exec and a resolver tool available in the image) and comparing the answer with the host.

When a name resolves but the connection still fails, the usual fix is to make the mapping explicit. Use a fully qualified domain name in the connection settings where your DNS supports it, or add a host entry through the Docker run option --add-host or the extra_hosts key in Compose, so the container gets the same address your server uses. Confirm the address with your network team, because a stale IP in a static entry will break silently after a database failover or a move to a new subnet. Also confirm that the database host listens on the interface the container reaches, not only on localhost.

Two other layers often look like a DNS problem. First, firewall and security group rules apply to the traffic source. Traffic from a container usually leaves through the Docker bridge and is NAT-translated to the host address, so a rule written for a single application server may not match, and a rule written only for the host may be broader than you intended. Second, TLS and credential mismatches fail after the name is resolved: the certificate name must match the hostname you used, and the database user must be allowed to connect from the address the database sees. Ask your database team which source addresses and certificate names they expect, and test the connection with the same credentials from a container on the same network before changing Metabase.

Keeping application data across container restarts

A Metabase container is disposable, but its application database is not. Whether your data survives a restart, a recreate or an image upgrade depends on where the application database lives and whether you back it up before changing anything. The cards below cover the storage choices and the checks that protect them.

Persist the H2 file with a volume

If you run the embedded H2 application database, the Metabase data is a file inside the container. Mount a persistent volume or host directory at the path where Metabase writes its H2 file, so the file survives when the container is removed. Confirm the mount with docker inspect before you rely on it. H2 is suited to demos, so treat this as a stopgap for a small test instance rather than a production design.

Metabase Docker docs

Move the application database off the container

For production, point Metabase at an external PostgreSQL or MySQL application database so the metadata lives outside the container lifecycle. Metabase recommends PostgreSQL for production, and MySQL 8.4.0 or MariaDB 10.6.0 and later with utf8mb4 are also supported. Inside Docker, the container must reach the database by a fully qualified hostname or a correct /etc/hosts entry, so test that connection from inside the container, not only from the host.

Application database docs

Back up before recreating containers

Removing and recreating a container does not touch an external database, but it does discard anything stored only in the container filesystem. Before you stop, remove or recreate a Metabase container, take a backup of the application database and record the image tag in use. Keep the encryption key with that backup, because stored database credentials cannot be read without it. Backup and restore procedures are covered in the sibling topic on backing up and restoring Metabase.

Check the encryption key before restoring

Metabase encrypts stored secrets, such as connection passwords, with an encryption key. A restored application database cannot decrypt those secrets if the key differs from the one used when the data was written. Store the key in your secrets manager alongside each backup, and verify it is the same value passed to the new container through its environment configuration. Confirm the exact variable name and handling in the current docs for your release.

Treat image upgrades as database changes

Starting a newer Metabase image runs application database migrations automatically, so an image tag change is a schema change, not just a restart. Take a backup first, then upgrade one release at a time when moving from versions older than 40. If the upgrade fails, the documented rollback is restoring the pre-upgrade backup, or running the migrate down command with the newer JAR. Pin image tags so an unplanned pull does not upgrade the database.

Upgrading Metabase docs

Questions teams ask before fixing or outsourcing Docker issues

How much effort does a typical Metabase container fix take?

The effort depends on which failure you have, how many layers are involved, and whether the fault sits in Metabase, the container runtime, the network or the database. A container that exits on startup because of a missing environment variable is usually a short read of the logs and a config change. A remote application database that is unreachable from inside the container can take longer, because the cause may be DNS, routing, a firewall rule or a hostname that only resolves on the host. The main drivers are the number of containers and networks, how much of the configuration is in version control, and whether you can reproduce the failure in a test environment. Ask any partner to estimate effort against your actual logs and topology rather than a generic figure.

Can our own team fix Metabase Docker problems without outside help?

Most teams can fix these failures in house if they have someone comfortable with Docker, container logs and basic networking. The work usually falls into four areas: reading the container and application logs, checking the connection from inside the container to the application database, confirming volume mounts and file ownership, and checking port mapping against the address Metabase advertises. The harder cases are the ones that combine several of these, such as an upgrade that failed mid-migration on a container with no persistent volume. In those cases, the skill gap is usually in the database and upgrade procedure rather than in Docker itself. Check your team's experience with the Metabase Docker troubleshooting guide before deciding.

What do we need to provide for a Metabase Docker fix?

A fix goes faster when the person doing the work has the following:

  • Container logs from the failing start, plus the exact image tag and the docker run or Compose file in use
  • Read access to the host, container runtime and any reverse proxy or firewall rules involved
  • A copy of the environment variables with secrets masked, including the application database settings
  • A test database or staging copy of the application database, so that changes are not first tried on production data
  • A change window agreed with the business, especially if a restart or a database migration is needed
  • A named owner who can approve configuration changes and confirm the result

Without a test environment, plan for a short window in which the service is unavailable while the change is made and checked.

How do upgrades interact with the application database and rollback in Docker?

Metabase runs its application database migrations automatically when a new version starts, so an upgrade changes the data your containers depend on. The Metabase upgrade documentation recommends backing up the application database before upgrading, and reducing a cluster to a single node for major upgrades because of a migration lock. Rollback is done by restoring the pre-upgrade application database backup, which is the recommended route, or by running the migrate down command with the newer JAR. In Docker, this means the application database must live outside the container, on a persistent volume or an external database, and the image tag must be pinned so a restart does not pull a newer version unexpectedly. If the application database is still the embedded H2 file, confirm its state before any upgrade, because the load-from-h2 migration must use the same Metabase version that last updated the file. Read the upgrade guide before you change tags.

Would a fixed-scope engagement with a partner cover Docker troubleshooting?

A fixed-scope engagement covers what is written into the scope before work starts, so the answer depends on how the problem is described. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms inside your own infrastructure, which can include a Metabase container fix when it is part of a defined deployment or remediation. A scope for this work would normally list the failure being addressed, the environments involved, the access required, the changes allowed, the verification steps and the handover documentation. Ongoing issues that recur after handover are better covered by a retainer. Ask for the written scope and deliverables before agreeing to a quote, since DeployOpen provides quotes based on that scope rather than a published price list.

Which Docker and Metabase details should we confirm with Metabase or our own environment?

Several details depend on your version and setup, so confirm them before you change anything. With Metabase, check the supported application database versions, the current release and its support status on the version support page, and the connection requirements in the application database documentation. In your own environment, confirm:

  • The fully qualified hostname or /etc/hosts entry the container uses to reach the application database
  • The volume path that holds application data, and the owner and permissions the container user needs
  • Which host port maps to which container port, and the public URL Metabase is configured to advertise
  • Whether your container runtime or orchestration platform sets resource limits that could stop the JVM

Record the answers so the next person can verify them without repeating the investigation.

Does using a partner mean we lose control of our Metabase data?

No. DeployOpen works inside the client's own cloud accounts, data centers or air-gapped networks, so the containers, volumes and application database stay under your control. Access should be granted for the scope of the work and removed when it ends, and the handover should include the configuration, the backup procedure and the runbook your team needs to operate the instance. Ask any partner to state in writing where the work runs, which credentials they need, how those credentials are stored and removed, and who keeps copies of logs or configuration files that contain connection details.

Upgrade and rollback risks in containerized Metabase

Changing the image tag on a containerized Metabase is a database change, not just a restart with newer code. Metabase runs application database migrations automatically when a newer version starts, so the first boot on a new image rewrites the schema that stores your users, groups, saved questions and dashboards. Treat every image tag change as a migration with a rollback plan already written. Before you pull a new tag, take a backup of the application database, whether it is PostgreSQL, MySQL or the H2 file, and confirm you can restore it. The upgrading guide recommends that backup as the first step, and it matters more in Docker because a container's writable layer is disposable: if the application database lives inside the container instead of a mounted volume or an external database, a replaced container can take your metadata with it.

Rollback has two documented routes. The recommended one is restoring the pre-upgrade application database backup, which returns the schema and data to the state the older image expects. The other is running the migrate down command with the newer JAR, which reverses migrations in place. In a container setup, the restore route is usually simpler to rehearse because it does not depend on the newer image still being available to run the down migration. Confirm with the upgrading guide that your chosen route works for your version pair, and keep the old image tag written down so you can start it against the restored database. Also note that a major upgrade on a cluster requires reducing it to a single node first because of a migration lock, so plan the container count change alongside the image change.

Check the version support page before you change a tag. Metabase 64 is an LTS release published on 16 September 2026 with end of life on 1 December 2027, and Metabase 65 was released on 12 October 2026. Non-LTS versions usually reach end of life after about two months, so a latest tag can move you onto a release that stops receiving fixes sooner than your change window allows. Pin explicit version tags in your compose file or orchestration manifest, record the support end date for each pinned version, and schedule upgrades before that date. Confirm current end-of-life dates on the Metabase version support page at the time of the change, since support windows can be updated.

Security considerations for Metabase containers

A Metabase container holds database credentials, reaches your application database, and writes logs that can contain query details. The cards below cover where those risks sit in a Docker deployment and what to check on each one. Work through them before the container first goes into a shared environment, then again after every image change.

Keep database credentials out of image layers

Pass the application database connection values at runtime through an environment file or a secrets mechanism your platform provides, not as ENV lines in a Dockerfile or as build arguments. Values baked into an image persist in its layers, so anyone who can pull the image can read them. Shell history matters too: a docker run command typed with a password inline stays in the history file. Check docker history on your image and confirm your shell history is disabled or scrubbed for deployment sessions.

Metabase Docker docs

Restrict who can reach the application database

The application database holds users, permissions, saved questions and the encryption-related settings that Metabase relies on. Place it on a container network that only the Metabase container joins, and avoid publishing its port to the host. Metabase connects to the application database from inside the container, so the hostname must resolve there. Confirm with a network inspection that no other container or host interface can open a connection to the database port.

Limit host ports to what the proxy needs

Publish only the Metabase HTTP port that your reverse proxy forwards to, and bind it to a loopback or internal interface where possible. Publishing -p 3000:3000 on all interfaces exposes the login page directly, bypassing TLS termination and any access logging at the proxy. Review the published ports with docker ps after each change, and confirm that the database and any debugging ports are not listed.

Run with least privilege on mounted volumes

Mounted host directories that hold application data or configuration should be owned by the user the container runs as, with write access limited to that user. Broad permissions such as world-writable directories let other local users alter the data or the configuration. When permission errors appear at startup, fix ownership on the host rather than running the container as root. Confirm the effective user with docker exec and check the mount permissions with ls -ln on the host.

Patch images on the version support schedule

Rebuild or repull the Metabase image whenever a release receives security updates, and track each version's end-of-life date. Metabase LTS versions are supported for 14 months, and non-LTS versions usually reach end of life after 2 months, so an unpatched image drifts out of support quickly. Before replacing a running container, back up the application database and read the upgrade guidance, because migrations run automatically on startup. Ask your team who owns the image update schedule and where image digests are recorded.

Metabase version support

Treat container logs as sensitive

Container logs can record connection errors, failed sign-in attempts and query text, and they are readable by anyone with access to the Docker socket or log driver. Decide where logs go, who can read them, and how long they are kept, and set a retention limit in your log driver or shipping pipeline. Avoid running debug log levels in production unless someone is actively troubleshooting, and remove any log output that echoes connection strings or tokens.

How the Metabase container, host and application database connect

The diagram starts with a user's browser reaching the host through a published port. Docker forwards that traffic into the Metabase container, which runs the Metabase JAR. From inside the container, Metabase reaches its application database over the container network, and that hostname must resolve from inside the container, not just from the host. A mounted volume holds the data that must survive a container restart, and the connected data sources sit beyond the container boundary. Check each hand-off when a container exits or a connection fails.

Traffic and trust boundaries between the browser, host, Metabase container and databases.

How a Docker troubleshooting engagement is scoped

A scoped Docker troubleshooting engagement starts with the evidence DeployOpen needs before anyone changes a setting. For a containerized Metabase, that means the container logs from the failing start or sign-in, the run command or Compose file that defines the image tag, environment variables, ports and volumes, and a description of where the application database lives. The network and volume layout matters as much as the configuration: which containers share a Docker network, how the application database hostname resolves from inside the Metabase container, and which host directories or named volumes hold the data. Scoping also confirms the Metabase image tag and the database engine, because a fault that appears to be a container problem can be a version or application database problem. Secrets such as the encryption key or database passwords should be redacted from anything shared, and the client should confirm in advance who may hand over that material.

Findings are written up as a fixed-scope deliverable. The written scope names the containers and hosts in play, the symptoms in scope, the evidence reviewed, the changes DeployOpen is permitted to make on a test copy versus the client's live environment, and the deliverables: a findings report with root cause, the exact configuration changes or commands recommended, and a verification step that shows each symptom is gone after the fix. Items outside the agreed symptoms, such as SSO or email configuration, are listed as separate work rather than absorbed. The commercial terms follow from that written scope, so the client should ask for the quote to map to the same list of containers, symptoms and deliverables. Ask whether the price covers one retest or several, and whether any follow-up for a later Metabase upgrade is included.

The client provides access and decisions. That usually means a named contact who can approve changes, read-only or time-limited access to the Docker host or orchestration platform, copies of logs and configuration with secrets removed, a maintenance window if a restart or volume change is needed, and a current backup of the application database before anything is modified. The client should also confirm which Metabase release is running and whether the team has an approved change process. Current behavior of the image, environment variable names and volume paths should be checked against the official Metabase Docker troubleshooting guide and the version-specific notes for the release in use before the scope is signed.

How DeployOpen scopes, delivers and supports Metabase on Docker

DeployOpen approaches Docker troubleshooting for Metabase as a scoped piece of work inside your own infrastructure, starting from the failing container, its logs and its configuration. Each engagement is fixed-scope, with the findings, fixes and handover agreed in writing before work begins.

How we scope

  • Written scope names the containers, images, hosts and runtime in use for the Metabase deployment.
  • Scope records how the application database is reached, whether it is H2, PostgreSQL or MySQL.
  • Scope lists the symptoms, logs and environment details your team gives us before work starts.
  • Engagements are fixed-scope, and ongoing support is available as a retainer after handover.

How we build

  • We reproduce the failure in a copy of your configuration, checking container exit codes and startup logs.
  • We verify database connectivity from inside the container, including hostname resolution and network routes.
  • We check volume mounts, data directory ownership and port mappings against the documented Docker setup.
  • We document each change to the run command, Compose file or environment variables so it can be reviewed.

How we hand over

  • You receive a written record of root causes, configuration changes and the commands used to verify them.
  • Handover includes a checklist confirming that application data persists across container restarts and recreation.
  • We walk your platform team through the corrected deployment so they can repeat the checks themselves.
  • Open items, such as upstream image changes to confirm, are listed with an owner and next step.

How we support

  • Retainers cover re-testing after Metabase image upgrades and changes to the container host.
  • Support includes reviewing new container configuration before it reaches production.
  • Ongoing work can include periodic checks that backups of the application database remain restorable.
  • Ask us to confirm which support level and response terms apply before the retainer starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.