Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Install Metabase with Systemd on Debian 11/10/9


By Josphat Mutai - October 25, 2021

Metabase is a simple and powerful analytics tool which lets anyone learn and make decisions
from their company’s data. No technical knowledge required to start using the tool. In this
guide, I’ll be showing you how to Install Metabase with Systemd on Debian 10 / Debian 9 Linux
system.

For Ubuntu, check: How to Install Metabase with Systemd on Ubuntu

To run the Metabase jar file you need to have Java installed on your system. Currently,
Metabase requires Java 8 or higher and will work on either the OpenJDK or Oracle JDK.

Step 1: Install Java on Debian


Update your APT package index:

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 1/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

sudo apt -y update

Then install Java JDK in the Debian system:

sudo apt install -y default-jdk

Verify that Java is installed and working.

$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode,
sharing) x

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 2/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Step 2: Install and configure the Database server ( MariaDB)


You can skip this step if you have a data store for Metabase already configured. For this lab,
we’ll use MariaDB database server which was set using the following guide.

Install MariaDB on Debian

Other database installation guides are:

Install MySQL 8 on Debian

Install PostgreSQL on Debian

I’ll create a database for use with Metabase on MySQL database server like below.

Login to MySQL shell as root user

sudo mysql -u root -p

Create a database and user with access privileges:

CREATE DATABASE metabase;


GRANT ALL PRIVILEGES ON metabase.* TO 'metabase'@'localhost' IDENTIFIED BY
"StrongPassword";
FLUSH PRIVILEGES;
QUIT

If the database server is remote, assign privilege to a user at specific IP address, e.g:

'metabase'@'192.168.0.20'

Or allow access from any IP – Not recommended for a server with public access:

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 3/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

'metabase'@'%'

Step 3: Install Metabase on Debian 10 / Debian 9


Download Metabase and save it on the path where you want the application to run from.

export VER=0.41.1
wget http://downloads.metabase.com/v${VER}/metabase.jar
sudo mkdir -p /apps/java
sudo cp metabase.jar /apps/java

The most basic way of running Metabase to use the java command to launch the
application.

$ java -jar metabase.jar


01-14 21:24:56 DEBUG plugins.classloader :: Using NEWLY CREATED classloader
as shared context classloader: clojure.lang.DynamicClassLoader@e044b4a
01-14 21:24:57 INFO metabase.util :: Loading Metabase...
01-14 21:24:57 INFO metabase.util :: Maximum memory available to JVM: 483.4
MB
01-14 21:25:01 INFO util.encryption :: Saved credentials encryption is
DISABLED for this Metabase instance. 🔓
For more information, see https://metabase.com/docs/latest/operations-
guide/encrypting-database-details-at-rest.html
.....

This will start the Metabase application using all of the default settings.

Step 4: Configure Metabase Systemd service


The best way to run Metabase is using Systemd init system available on both Debian 10 /
Debian 9. A separate guide on running Java applications with systemd is available on our blog.

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 4/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

How to run Java Jar Application with Systemd on Linux

For the sake of simplicity, I’ll do a specific systemd service file for metabase

Start by creating a system group for the user.

sudo groupadd -r appmgr

Next, we create a system user appmgr with the default group

sudo useradd -r -s /bin/false -g appmgr appmgr

Give this user ownership permission to the applications directory:

sudo chown -R appmgr:appmgr /apps/java

Create a systemd service unit file:

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

Add the contents below to the file.

[Unit]
Description=Metabase applicaion service
Documentation=https://www.metabase.com/docs/latest

[Service]
WorkingDirectory=/apps/java
ExecStart=/usr/bin/java -Xms128m -Xmx256m -jar metabase.jar
User=appmgr
Type=simple
Restart=on-failure
x
RestartSec=10

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 5/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

[Install]
WantedBy=multi-user.target

Set your values for maximum and minimum memory allowed for the Java application ( -
Xms128m and -Xmx256m  ) in my case

The next thing to do is start the application service, but first, reload systemd so that it loads
the new application added.

sudo systemctl daemon-reload

Once reloaded, start the service and set it to start on boot:

sudo systemctl start metabase.service


sudo systemctl enable metabase.service

To check the status, use:

$ systemctl status metabase


● metabase.service - Metabase applicaion service
Loaded: loaded (/etc/systemd/system/metabase.service; enabled; vendor
preset: enabled)
Active: active (running) since Tue 2020-01-14 21:49:02 UTC; 55s ago
Docs: https://www.metabase.com/docs/latest
Main PID: 3698 (java)
Tasks: 65 (limit: 2377)
Memory: 604.1M
CGroup: /system.slice/metabase.service
└─3698 /usr/bin/java -Xms128m -Xmx256m -jar metabase.jar

Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.analyze ::


classify-tables Analyzed
[**************************************············] 😋
Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.analyze ::
classify-tables Analyzed
[**********************************************····] 😍
Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.util :: FINISHED:
step 'classify-tables' for h2 Database 1 'Sample Dataset' (15.8 ms)
Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.util :: FINISHED:
Analyze data for h2 Database 1 'Sample Dataset' (5.6 s)
Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.util :: STARTING: x
Cache field values in h2 Database 1 'Sample Dataset'

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 6/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Jan 14 21:49:33 deb10 java[3698]: 01-14 21:49:33 INFO sync.util :: STARTING:


step 'update-field-values' for h2 Database 1 'Sample Dataset'
Jan 14 21:49:34 deb10 java[3698]: 01-14 21:49:34 INFO sync.util :: FINISHED:
step 'update-field-values' for h2 Database 1 'Sample Dataset' (809.0 ms)
Jan 14 21:49:34 deb10 java[3698]: 01-14 21:49:34 INFO sync.util :: FINISHED:
Cache field values in h2 Database 1 'Sample Dataset' (811.6 ms)
Jan 14 21:49:34 deb10 java[3698]: 01-14 21:49:34 INFO sync.util :: FINISHED:
Sync h2 Database 1 'Sample Dataset' (7.5 s)
Jan 14 21:49:34 deb10 java[3698]: 01-14 21:49:34 INFO metabase.core ::
Metabase Initialization COMPLETE

Step 4: Access Metabase Web User Interface


After the service is started, Metabase server will listen on port 3000 by default.

$ ss -tunelp | grep 3000


tcp LISTEN 0 50 *:3000 *:* users:(("java",pid=14386,fd=18)) uid:998
ino:85041 sk:a v6only:0 <->

Access the web page to finish setup using http://<serverip>:3000

Click “Let’s get started” button to start the setup. On the next page, create a user to manage
Metabase

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 7/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Provide info about your MySQL database – username and password. If you don’t have that
right now, Metabase also comes with a sample dataset you can get started with.

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 8/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

You need to feed your data to the database configured above. Metabase will check for data
there. Once you finish the setup, you’ll get access to Metabase Administration panel

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 9/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

See the Metabase getting Started page to start adding Dataset and playing with your data.
Also, visit Official metabase documentation for detailed setup and administration.

Also check:

How to Install Latest phpMyAdmin on Debian

How to Install pgAdmin 4 on Debian

How to Install ArangoDB on Ubuntu

Install Dgraph on CentOS 7 / Ubuntu

YOU CAN SUPPORT OUR WORK WITH A CUP OF COFFEE

As we continue to grow, we would wish to reach and impact more


people who visit and take advantage of the guides we have on
our blog. This is a big task for us and we are so far extremely
grateful for the kind people who have shown amazing support for
our work over the time we have been online.

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 10/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Thank You for your support as we work to give you the best of
guides and articles. Click below to buy us a coffee.

Josphat Mutai
https://computingforgeeks.com/

Founder of Computingforgeeks. Expertise in Virtualization, Cloud, Linux/UNIX Administration, Automation,Storage


Systems, Containers, Server Clustering e.t.c.

 

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 11/12
6/7/23, 18:08 Install Metabase with Systemd on Debian 11/10/9 | ComputingForGeeks

Sponsored Content Recomendado por

¡La diabetes no es por lo dulce! Conoce al enemigo de la


diabetes

Prohibido Durante 84 More People Switching If you own a mouse,


Años; el Potente To VoIP Phones (Take you have to play this
Analgésico Ahora Le… A Look At The Prices) game. No Install. Pla…
healthyedibles4-you.com VOIP Phones | Search Ads Panzer.Quest strategy game

https://computingforgeeks.com/install-metabase-with-systemd-on-debian-linux/?expand_article=1 12/12

You might also like