Giter Club home page Giter Club logo

compose-postgres-metabase's Introduction

Dockerized Metabase with PostgreSQL backend

Metabase is an open-source java-based software that enables users to analyse data from a range of data sources including relational databases (e.g. Postgresql, MySQL etc.), NoSql databases etc.

It can be quite helpful when one has a data science question that could easily be answered by data analysis.

By default, it stores application-specific data e.g. users, stored queries, configurations etc. on an H2 database on the same file system where it is installed.

However, it is difficult to retrieve this data once the application crushes (which it might do if you write a wrong sql query for it to run on your data). It is therefore usually better to have the application save the data in a postgreSQL database such that it recovers its original state after any crush.

Technology used

Technology Usage
Docker metabase and postgres run in different Docker containers
Docker Compose Docker compose netwroks the different Docker containers to allow them work together as dependent services
Metabase SQL based Analysis and Visualization program for any database
Postgres A database engine that stores relational data in a persistent way

How to run

This assumes the local machine is running on Ubuntu

  1. Ensure docker is installed. If it is not installed, install it. Here are the instructions.

  2. Ensure docker compose is installed on your system. If it is not installed, install it. Here are the instructions.

  3. Clone this git repository

      git clone https://github.com/Tinitto/compose-postgres-metabase.git
  4. Enter the compose-postgres-metabase folder

      cd compose-postgres-metabase
  5. Convert config/metabase_database.env.example to config/metabase_database.env.

  6. Update the environment variables MB_DB_PASS, MB_DB_HOST, MB_ENCRYPTION_SECRET_KEY and save.

    ENV MB_DB_PASS=<put_here_the_password_for_the_metabase_user>
    # Make sure the firewall at the database server allows connections to port 54320
    ENV MB_DB_HOST=<put here the IP address for the Metabase database server e.g. 00.000.000.00>
    ENV MB_ENCRYPTION_SECRET_KEY=<Add a random string here as the secret>
  7. Convert config/postgres.env.example to config/postgres.env.

  8. Update the environment variables POSTGRES_PASSWORD, METABASE_PASSWORD and save.

    # Add the password for the postgres user
    POSTGRES_PASSWORD=<put here the_password for the postgres user>
    # Add the password for the metabase user
    METABASE_PASSWORD=<put here the password for the metabase user>
  9. Start the docker compose services

      sudo docker-compose up -d
  10. Set up your metabase instance by visiting the local metabase start URL If you are on a server, use http://<server IP>:3000.

Service - Port Mappings

Service Port
Metabase 3000
Postgres 54320

Acknowledgement

Some of the configuration was learnt from the Beyond Jupyter talk by Joshua Gorner

compose-postgres-metabase's People

Contributors

tinitto avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.