How to deploy Metabase using docker, Postgres, and Nginx
Metabase is an open-source data analysis tool that has gained a lot of attention in the community in recent years.
One of its strengths is that you can just “plug and play” your database into it and start extracting cool insights from your application all “plug and play”.
The Metabase currently supports the following databases:
- Amazon Redshift
- Google Analytics
- Google BigQuery
- MongoDB (version 3.4 or higher)
- MySQL (version 5.7 or higher, as well as MariaDB version 10.2 or higher)
- SQL Server
But of course, ideally, you have a separate database to use in your Metabase that is a faithful copy of the production environment a few hours or at most a day apart.
To make the deployment process easy, i created this project on Github:
I use docker with these services
- Postgres - for Metabase database (users, passwords, etc.)
Why use NGINX?
You could even directly expose port 80 in your docker container, but that’s not cool.
So that’s why I used the Nginx server to create a reverse proxy from Metabase port 3000 to default port 80.
This way, you can point your DNS directly to your server’s IP and by default, the Metabase will already appear in your browser :)
How to deploy the Metabase?
- Clone the project at https://github.com/paulocastellano/metabase-docker-template
- Create a file called .env in the project root and paste the contents of the .env.example file into it.
- Enter the database username and password you want
- Run the following command: docker-compose up or docker-compose up -d to run in the background
After you build and upload your docker container, you should see a screen that looks like this: