Metabase Setup (Raspberry Pi)
Metabase is an open-source BI tool that turns database data into graphs and tables in the browser. You can create summary screens without writing SQL, so it is convenient for quickly visualizing PLC data recorded in MariaDB.
This page describes the steps to run Metabase on a Raspberry Pi and connect it to MariaDB on the same Raspberry Pi. Everything stays within the company LAN with no internet connection.
If you also want to view it from outside or on a smartphone, consider "Grafana Cloud (free tier)", which runs in the cloud.
Environment
| Item | Description |
|---|---|
| Hardware | Raspberry Pi 4 Model B(4GB) |
| OS | Raspberry Pi OS(64-bit) |
| Java | Eclipse Temurin 25(JRE) |
| Metabase | OSS edition (jar file) |
| Access | http://192.168.0.100:3000/ |
Installing Java 25
The latest Metabase requires Java 25. It is not in the standard Raspberry Pi OS repositories, so install it from the Eclipse Temurin (Adoptium) repository.
$ sudo apt install -y wget apt-transport-https gpg $ wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null $ echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list $ sudo apt update $ sudo apt install -y temurin-25-jre $ /usr/lib/jvm/temurin-25-jre-arm64/bin/java -version
default-jdk (Java 17) installed in the initial setup remains as is, and only Metabase runs on the Java 25 at the path above. Older versions of Metabase (v0.43 etc.) also work with Java 17.
Download and check operation
Here, create a metabase directory in the home of user pi and put the jar file in it.
$ mkdir -p ~/metabase $ cd ~/metabase $ wget -O metabase.jar https://downloads.metabase.com/latest/metabase.jar
To download with a browser, get it from the Metabase official site (OSS edition) and copy it to the directory above.
First start it manually to check operation (stop with Ctrl+C).
$ /usr/lib/jvm/temurin-25-jre-arm64/bin/java -jar metabase.jarOpen http://192.168.0.100:3000/ in a browser on your PC. The first startup takes a few minutes on a Raspberry Pi, so wait until the log shows "Metabase Initialization COMPLETE".
Autostart as a service
Creating the unit definition file
Register it as a systemd service so it starts automatically when the Raspberry Pi boots.
$ sudo nano /etc/systemd/system/metabase.service[Unit]
Description=Metabase server
After=network-online.target mariadb.service
Wants=network-online.target
[Service]
WorkingDirectory=/home/pi/metabase
ExecStart=/usr/lib/jvm/temurin-25-jre-arm64/bin/java -Xmx1g -jar /home/pi/metabase/metabase.jar
# Environment variable file (port change etc.). The leading "-" means no error if the file does not exist
EnvironmentFile=-/etc/default/metabase
User=pi
Type=simple
SyslogIdentifier=metabase
SuccessExitStatus=143
TimeoutStopSec=120
Restart=always
[Install]
WantedBy=multi-user.target-Xmx1g is the upper limit of memory used by Metabase. It is a guideline for running alongside other services on a 4 GB model, so adjust it to your environment.To change the port from 3000, write something like
MB_JETTY_PORT=8080 in /etc/default/metabase.
Registering and starting the service
$ sudo systemctl daemon-reload $ sudo systemctl enable --now metabase.service $ systemctl status metabase.service
Checking logs
On current Raspberry Pi OS, logs can be checked with journald (the systemd log).
$ journalctl -u metabase -fIf you want to write logs to a file with rsyslog as on older OSes, install rsyslog and add routing settings.
$ sudo apt install -y rsyslog $ sudo nano /etc/rsyslog.d/metabase.conf
if $programname == 'metabase' then /var/log/metabase.log & stop
$ sudo systemctl restart rsyslogConnecting to MariaDB
After creating an admin user on the Metabase initial setup screen, enter the following under "Add a database" to graph MariaDB data.
| Item | Setting |
|---|---|
| Database type | MySQL (choose this for MariaDB too) |
| Host | localhost |
| Port | 3306 |
| Database name | testDB |
| Username/password | testuser/passwd |
Summary
Now, just by opening http://192.168.0.100:3000/ in a browser on a PC in the company LAN, you can check PLC data recorded in MariaDB as tables and graphs.
Create graphs with Metabase "Questions" and combine them in a "Dashboard" to check equipment status on one screen.
Related pages

Initial setup and server construction
Setup steps for static IP, Apache, PHP and MariaDB

Grafana Cloud (free tier)
Visualize the Raspberry Pi's MariaDB from Grafana in the cloud without opening ports

What is a Raspberry Pi
Introduces the history, specs of current models and PLC integration configurations
Reference
- Metabase setup (obenkyolab, Japanese)
- Metabase official documentation: Running the Metabase OSS JAR file
- Eclipse Temurin (Adoptium) installation on Linux
Raspberry Pi is a trademark of Raspberry Pi Ltd.
