paint-brush
How To Deploy Metabase on Google Cloud Platform (GCP)?by@jph98
6,190 reads
6,190 reads

How To Deploy Metabase on Google Cloud Platform (GCP)?

by JonAugust 23rd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Metabase is a business intelligence tool for your organisation that plugs in various data-sources so you can explore data and build dashboards. It's available as a JAR file and also as a Docker container. There are multiple ways to get Metabase up and running on Google Cloud. I'll aim to provide a series of articles on provisioning and building this out for organisations. Metabase runs as a Java app and starts-up on port 3000. The next article will look at the basics of building a dashboard in the next article.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How To Deploy Metabase on Google Cloud Platform (GCP)?
Jon HackerNoon profile picture

Metabase is a business intelligence tool for your organisation that plugs in various data-sources so you can explore data and build dashboards. I'll aim to provide a series of articles on provisioning and building this out for your organisation. This article is about getting up and running quickly.

There are multiple ways to get Metabase up and running on Google Cloud.

https://www.metabase.com/docs/latest/operations-guide/installing-metabase.html

You can install it locally on your Mac as well as popular cloud platforms. It's available as a JAR file and also as a Docker container.

I went via the Docker container route and Google Cloud Platform.

Step 1 - GCloud Developer Tools Setup

Make sure you have GCloud developer tools setup. You can do this via the instructions here.

After that, you'll need to login to your Google account and also configure Docker to work with your credentials. In my case I generated a new service account in GCP to access Google BigQuery (my chosen reporting database). I then downloaded the corresponding service account JSON file.

gcloud auth login
gcloud auth configure-docker

Step 2 - Deploying Metabase to GCP

Metabase docker images are on Dockerhub here.

https://hub.docker.com/r/metabase/metabase/tags

However, I wanted these in Google Cloud Registry for performance and reliability reasons.

You can pull the Docker image using the following:

docker pull metabase/metabase:latest

Tag the docker image with the following:

  • hostname — eu.gcr.io
  • projectname — krustysfunhouse
  • tag — metabase

docker tag metabase/metabase:latest eu.gcr.io/krustysfunhouse/metabase

Deploy the Docker image to Google Cloud Registry with the following

docker push eu.gcr.io/krustysfunhouse/metabase:latest

Step 3 - Compute Engine Instance

Create a Compute Engine instance:

- Specify the GCR image you've just uploaded:

eu.gcr.io/krustysfunhouse/metabase:latest

  • Specify vCPU and Memory (I used 1 vCPU and 3.75GB)
  • Specify the region, I've used London (europe-west2-c) here.

n.b. You'll have a container optimized OS by default.

Step 4 - Getting Access

Once that instance is provisioned you can login from gcloud via the console with the following:

gcloud beta compute ssh --zone "europe-west2-c" "metabasereporting" --project "krustysfunhouse"

Metabase runs as a Java app and starts-up on port 3000. If you want to get into installing Nginx or GCP Load Balancing that’s a different story. For this, I opened up access to port 3000. Add a new Firewall Rule to allow traffic to access tcp:3000 for now — example below. Then add this “name” to the machine VM instance as a network tag.

You should lock this down to your office IP ideally, or setup a VPN so that you access this securely. Once running, you will have a publically accessible instance that is subject to brute-force attack in terms of username/password.

By default, Metabase will make you specify a default email and password, but still this isn't production ready.

I'll look at the basics of building a dashboard in the next article, but hopefully that should be good enough to get you started.

I'm a Consulting CTO working as an architect and engineer with startups and scaleups. A large part of my career was spent working in analytics companies and data-heavy companies often with the aim of building/transforming data-platforms. You can find out more about me (and hire me for advice, fractional or interim work) here:

https://www.hwintegral.com/

That's all for now...