Metabase is a data analyzer and visualizer tool which can connect to many types of databases.

It can do some smart analysis as well as let you write proper SQL queries to create charts and graphs.

Metabase is a Java application which can be run directly. Conversely, it can also be run via Docker.

Create metabase folder

Metabase maintains a database of it’s own from whenever the application is run. So it is best to create a folder for Metabase.

$ ~/metabase > ls

Run Metabase

From the command prompt

$ ~/metabase > java -jar metabase.jar

This runs the Metabase app in the foreground in (accessible from then web directly)

Run in background

It is obviously required for Metabase to run in the background. For this –

$ ~/metabase > nohup java -jar /home/<username>/metabase/metabase.jar &

Run on localhost instead

For this we need to set the environment variable MB_JETTY_HOST to before running Metabase.

$ ~/metabase > export MB_JETTY_HOST=

Rerun Metabase once the environment variable is set to have it run on localhost:3000

Nginx configuration

Nginx configuration helps to map a subdomain to the Metabase instance

server {
  listen 80;
  listen [::]:80;


  access_log      /var/log/nginx/metabase-access.log;
  error_log       /var/log/nginx/metabase-error.log;

  gzip on;
  client_max_body_size 10m;

  location / {
    proxy_pass http://localhost:3000;

Run Metabase on domain subpath

Sometimes, we need to run Metabase on localhost but redirect to it via a subpath.

For example, we might want as our main Metabase URL.

In this case, we need to set another environment variable MB_SITE_URL

$ ~/metabase > export MB_SITE_URL='https:/

NOTE the trailing slash at the end of the URL

Nginx configuration for subpath redirect

server {
  listen 80;
  listen [::]:80;


  location /metabase/ {
    proxy_pass http://localhost:3000/;

AGAIN NOTE the trailing slash at the end of the URL and the subpath


Metabase Documentation
List of environment variables