Metabase is an open-source business intelligence (BI) platform that lets you create dashboards, charts, and reports through an intuitive web interface. You can even ask questions about the data through a web-based interactive GUI.
In this tutorial, I will tell you how you can install Metabase on Ubuntu 26.04 with Nginx and Let’s Encrypt SSL. We will use MySQL as the application database for Metabase. You can even use PostgreSQL instead of MySQL. We will use Nginx as our web server. Although, we will configure SSL too in this setup but to add more security, you can change SSH port and you can even configure Fail2ban.
So without talking much, let’s begin
Prerequisites
- A server with Ubuntu 26.04 installed
- A user with sudo privileges
Step 1 – Update the System
The first step is to update the system so that we will be able to install all the latest packages
sudo apt update -y
sudo apt upgrade -y
Step 2 – Install and Setup Java
Next let’s install JDK. At the time of writing this tutorial, OpenJDK 25 is the current LTS release, so we’ll install it using the following command.
sudo apt install openjdk-25-jdk -y
Let’s verify the installation by checking java version
java -version
You should get an output as
OpenJDK version "25" 2025-09-16
OpenJDK Runtime Environment (build 25+35-Ubuntu-0ubuntu1)
OpenJDK 64-Bit Server VM (build 25+35-Ubuntu-0ubuntu1, mixed mode, sharing)
Step 3 – Download and Install Metabase
Next, let’s download and install Metabase from the official website using wget. But before that let’s first create a folder
sudo mkdir /opt/metabase
cd /opt/metabase
wget https://downloads.metabase.com/latest/metabase.jar
Step 4 – Create Metabase Service File
Now we will create a Metabase file so that we can manage it with systemd
sudo nano /etc/systemd/system/metabase.service
Copy and paste the following
[Unit]
Description=Metabase server
After=network.target
[Service]
WorkingDirectory=/opt/metabase
ExecStart=/usr/bin/java -jar /opt/metabase/metabase.jar
User=metabase
Type=simple
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=metabase
Environment=MB_DB_TYPE=mysql
Environment=MB_DB_HOST=localhost
Environment=MB_DB_PORT=3306
Environment=MB_DB_DBNAME=metabase
Environment=MB_DB_USER=metabaseuser
Environment=MB_DB_PASS=secure_password
[Install]
WantedBy=multi-user.target
Note:- Make sure to change 'secure_password' to a strong password.
Save by pressing ctrl+x,y and then Enter.
Step 5 – Create Metabase User
To manage Metabase services, let’s create a dedicated user for Metabase
sudo useradd -r -s /bin/false metabase
sudo chown -R metabase: /opt/metabase
Step 6 – Install and Configure MySQL
Next, let’s install and configure MySQL, which will be used as the application database for Metabase.
sudo apt install mysql-server -y
Now let’s setup the database
sudo mysql
CREATE DATABASE metabase;
CREATE USER 'metabaseuser'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON metabase.* TO 'metabaseuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Note:- Make sure to change 'secure_password' to a strong password.
Step 7 – Start and Enable metabase Service
Now let’s start and enable the Metabase and daemon services
sudo systemctl daemon-reload
sudo systemctl start metabase
sudo systemctl enable metabase
To check if Metabase is running as intended you can check its status
sudo systemctl status metabase
sudo journalctl -u metabase -f
Step 8 – Updating Firewall
Now let’s configure the firewall to allow http and https connections
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload
Step 9 – Install and Configure Nginx
Next let’s install and configure Nginx web server
sudo apt install nginx -y
sudo nano /etc/nginx/sites-available/metabase.example.com
paste the following
server {
listen 80;
server_name metabase.example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_read_timeout 600s;
}
}
Now link the Nginx configuration file to sites-enabled
sudo ln -s /etc/nginx/sites-available/metabase.example.com /etc/nginx/sites-enabled/
Let’s test Nginx and restart it
sudo nginx -t
sudo systemctl restart nginx
Step 10 – Configuring Let’s Encrypt SSL
Now let’s secure our setup by configuring Let’s Encrypt SSL. For SSL we will use certbot which will also manage and renew our SSL certificate
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d metabase.example.com
Note: Make sure to change "metabase.example.com" to your real domain name.
Access Metabase
Now, since Metabase runs on port 3000, you can open any browser and enter “https://metabase.example.com” and follow the setup. Make sure to use the details as per above steps.
Conclusion
With this, you have successfully installed Metabase on Ubuntu 26.04 with SSL. You can now start using it via web-based interface.
Frequently asked questions
Why should I use Nginx with Metabase?
Nginx acts as a reverse proxy, allowing users to access Metabase through a domain name instead of its default port (3000). It also makes it easier to enable HTTPS with Let’s Encrypt SSL and improves security by hiding the application’s internal port.
Can I use PostgreSQL instead of MySQL?
Yes. Metabase supports both MySQL and PostgreSQL as its application database. This tutorial uses MySQL for simplicity, but you can configure PostgreSQL by updating the database settings in the Metabase service file.
Is Metabase free to use?
Yes. Metabase offers a free and open-source Community Edition that includes dashboard creation, data visualization, SQL querying, and reporting. Paid editions are also available for organizations that need advanced features such as enhanced authentication, permissions, and enterprise support.