Deploying Metabase in a Private Network using Serverless Containers
Metabase is an open-source business intelligence platform. You can use Metabase to ask questions about your data, or embed Metabase in your app to let your customers explore their data on their own. Metabase provides an official Docker image via Docker Hub that can be used for deployments on any system that is running Docker.
This tutorial guides you through the steps to deploy Metabase with Serverless Containers, backed by a Managed Databases for PostgreSQL Database Instance, in a Private Network for enhanced security.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- Created a Private Network within a dedicated VPC
Creating a PostgreSQL Database Instance
-
Create a Database Instance with the latest PostgreSQL versions in the same region as your Private Network. You can keep the default parameters, or change them according to your needs.
-
Once your Database Instance is ready, attach your previously created Private Network from the Network Section of the Overview tab.
-
Still from the Network section of the Overview tab, click Remove next to Public endpoint to prevent connections from the public Internet.
Your Database Instance is now ready to be used with Metabase.
Deploying Metabase with Serverless Containers
-
Create a Serverless Container with the parameters below. You can keep the other values as default, or change them according to your needs.
- External container registry
- Image URL:
metabase/metabase
- Container port:
3000
- VPC: the Private Network attached to your Database Instance
-
Add the following environment variables:
Key Value Comment MB_DB_TYPE
postgres
MB_DB_DBNAME
rdb
From the Databases tab of your Database Instance ( rdb
by default)MB_DB_PORT
5432
Default PostgreSQL port MB_DB_HOST
172.16.0.2
Private Network endpoint, visible from the Network section of the Overview of your Database Instance MB_DB_USER
user
The username defined during Database Instance creation. Visible from the Users tab MB_JETTY_HOST
0.0.0.0
Must be set to prevent Metabase from listening on localhost
-
Add the following secret:
Key Value Comment MB_DB_PASS
password
The password defined during Database Instance creation -
Review the estimated cost, then click Deploy container to finish. Deploying a Serverless Container for the first time can take several minutes.
-
Once your Serverless Container is in a Ready state, you can access your Metabase deployment using the container endpoint visible from its Overview.
Refer to the official documentation for comprehensive information on how to use Metabase.
Going Further
You can quickly deploy Metabase in a Private Network using Serverless Containers with Terraform/OpenTofu. Refer to our Serverless Example for more information.
Visit our Help Center and find the answers to your most frequent questions.
Visit Help Center