Metabase as a service for Ubuntu

This is how I installed Metabase in Ubuntu using systemd and services: I am using MySQL and configured the service to get started at system boot time and have the possibility to stop it when I want..

Install Metabase

Downloaded the jar file from and put it inside /var/www/metabase

wget -P /var/www/metabase


Create the service

sudo nano /etc/systemd/system/metabase.service


Paste the following inside this file:

Description=Metabase service
# The configuration file should be here:
#change this to your workspace
#path to executable: executable is a bash script which calls jar file


Create a Bash Script to call the service

I created the bash file inside my metabase folder:

sudo nano /var/www/metabase/metabase


I prefer to use MySQL instead of H2 default database so: I added the necessary environment variables for that in my script.

sudo /usr/bin/java -DMB_DB_TYPE=mysql -DMB_DB_DBNAME=metabase -DMB_DB_PORT=3306 -DMB_DB_USER=<username> -DMB_DB_PASS="<password>" -DMB_DB_HOST=localhost -jar metabase.jar


Give it execute permission:

sudo chmod u+x /var/www/metabase/metabase


Start the Metabase service

sudo systemctl daemon-reload
sudo systemctl enable metabase.service
sudo systemctl start metabase
sudo systemctl status metabase

Upgrading Metabase

Suppose I want to upgrade to version 0.29.0 then I do the following:

sudo wget -P /var/www/metabase -O/var/www/metabase/metabase-new.jar && sudo service metabase stop && sudo mv metabase.jar metabase-old.jar && sudo mv metabase-new.jar metabase.jar && sudo service metabase start