Install and Use Metabase

Preface

Metabase is an open-source data analysis tool that is easy to operate and can connect to various data sources. Although its data analysis capabilities are not as powerful as Excel, Metabase is sufficient for daily use. Moreover, I am more capable of writing SQL than clicking Excel sheets, so Metabase is a good choice for me.

Docker compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: '3'

services:
metabase:
image: metabase/metabase:v0.49.5
container_name: metabase
restart: unless-stopped
environment:
JAVA_TIMEZONE: Asia/Shanghai
ports:
- 42233:3000
volumes:
- metabase_data:/metabase.db
healthcheck:
test: out=$$(curl localhost:3000/api/health); echo $$out | grep '"status":"ok"' || { echo $$out; exit 1; }
start_period: 30s
interval: 2m
timeout: 3s
retries: 2

volumes:
metabase_data:
external: true
  • Metabase uses the h2 database by default, stored in the /metabase.db directory. In the production environment, it is recommended to use MySQL or PostgreSQL (this step is not necessary for personal use).

Usage

You can refer to this tutorial for basic usage of Metabase, which covers most types of charts and is suitable for beginners who have not been exposed to data analysis before.


It is worth mentioning how to delete a question or dashboard:

  • First, archive the question or dashboard you want to delete:

    image-20240502141222546

  • Then go to the Archive page (or enter from /archive):

    image-20240502141306567

  • Click delete here:

    image-20240502141533004

References