A step by step tutorial on how to deploy the Metabase business intelligence web app on a Linux Ubuntu 22.04 server using Docker
In this tutorial, I will guide you through the process of setting up Metabase on a Linux Ubuntu 22.04 LTS server using Docker. Metabase is a web-based intelligence and reporting application that can help you to discover insights about your business. It is a system that can connect to almost any cloud-hosted or self-hosted relational or non-relational database and has a built-in questionnaire builder tool that allows you to build complex intelligent queries. In this video, you will learn how to install docker and docker-compose. You will learn how to create a .yml docker-compose config file for Metabase. Read or watch the video right up to the end to quickly setup Metabase for your business.
Requirements
In order to complete this tutorial, the following is a list of things that you may need to complete this tutorial successfully:
1) A desktop or laptop with at least 4GB RAM, a dual-core processor, and at least 50GB of free disk space
2) A Linux Ubuntu 22.04 LTS virtual machine
3) Docker and docker-compose
4) A web browser i.e Google Chrome, Mozilla Firefox, Internet Explorer or Safari
5) The Metabase docker image.
Overview
1) Connect to your Linux Ubuntu Server via SSH and install system and package updates
2) Download and install docker and docker-compose
3) Create a compose .yml file and deploy the Metabase docker container
4) Download and install OpenLiteSpeed Web Server and configure it as a reverse proxy server for Metabase
5) Complete the Metabase post installation setup.
Step 1: Connect to your Linux Ubuntu Server via SSH and install system and package updates.
The first step in completing this setup is to connect to your Linux Ubuntu Server via SSH. If you are using a Mac or Linux based desktop computer, run the command below to connect:

If you are using a Windows-based PC, You can use the Putty SSH client. Download and install Putty on your computer. Type in the IP Address of the Ubuntu server on the HOST NAME (OR IP ADDRESS) field, ensure that PORT is set to 22, and click OPEN. Type in your Ubuntu username and password on the prompt to login.

Step 2: Download and install docker and docker-compose
Docker is a container management system that simplifies the deployment process of an application such as Metabase. It allows Metabase developers to package the application and all its related operating system-level dependencies in a single package known as a docker image. Docker compose is a utility used for running multi-container applications on Docker defined using a compose .yml file. Metabase is a multi-container application; you will need both docker and docker-compose to deploy it. Run the commands below to install docker and docker-compose on your Ubuntu server

Step 3: Create a compose .yml file and deploy the Metabase docker container
The next step is to create a compose .yml file and deploy the Metabase docker container. Run the following commands:
Press CONTROL + O, press ENTER then press CONTROL + X to exit out of the file

Run the following command to deploy the docker container. Please note that the -d flag tells docker-compose to run the container in the background so the command doesn’t take over your terminal window
When the installation is complete, you can test Metabase using curl. You should get an HTTP 200 OK response

Step 4: Download and install OpenLiteSpeed Web Server and configure it as a reverse proxy server for Metabase

Next, open a new browser window and type in http://your-server-ip:7080. Type in the username and password that you configured as administrator and click Login.
Click Virtual Hosts and click Add. Set Virtual Host Name to Metabase and set Virtual Host Root to $SERVER_ROOT/metabase. Set Config File to $SERVER_ROOT/conf/vhosts/$METABASE/vhconf.conf. Set the Enable Scripts/ ExtApps option to Yes and set Restrained to No. Click Save

You will see an error message informing you that the file /usr/local/lsws/conf/vhosts/$METABASE/vhconf.conf does not exist. Click on CLICK TO CREATE to create the file and click SAVE.

Click VIEW on the Metabase Virtual Host that you have created and click GENERAL. Click Edit on the General section and set Document Root to $VH_ROOT. Click on the External App tab and click Add. Set Type to Web Server and click Next. Set Name to Metabase and set Address to http://127.0.0.1:3000. Set Max Connection s to 100, Initial Request Timeout (secs) to 60, and Retry Timeout (secs) to 60. Scroll up and click Save to apply changes.

Click on the Context tab and click Add. Set Type to Proxy and click Next. Set URI to / and select the Metabase external app on the Web Server drop-down menu. Click Save to Apply changes

Click on the Listeners tab and click View on the Default Listener. Click Edit on the Address Settings section, set Port to 80, and click Save. Click Add on the Virtual Host Mappings section. Select the Metabase Virtual Host and set Domains to yourdomain.com. Click Save to apply changes.

Step 5: Complete the Metabase post installation setup.
Open a new browser window and type in the domain name for the Metabase server. You will see a Metabae welcome page. Click on let’s Get Started to start the post-installation setup

Select your preferred language and click Next.

Type in your personal details and click Next

Click ‘I’LL ADD MY DATA LATER’ and click Next. Click Finish to complete the post-installation setup
