Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

Deploying Metabase in a Private Network using Serverless Containers

deploy
metabase
virtual
private
cloud
private
networks
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:

Creating a PostgreSQL Database Instance

  1. 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.

  2. Once your Database Instance is ready, attach your previously created Private Network from the Network Section of the Overview tab.

  3. 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

  1. Create a VPC-enabled Serverless Containers Namespace.

  2. 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
  3. Add the following environment variables:

    KeyValueComment
    MB_DB_TYPEpostgres
    MB_DB_DBNAMErdbFrom the Databases tab of your Database Instance (rdb by default)
    MB_DB_PORT5432Default PostgreSQL port
    MB_DB_HOST172.16.0.2Private Network endpoint, visible from the Network section of the Overview of your Database Instance
    MB_DB_USERuserThe username defined during Database Instance creation. Visible from the Users tab
    MB_JETTY_HOST0.0.0.0Must be set to prevent Metabase from listening on localhost
  4. Add the following secret:

    KeyValueComment
    MB_DB_PASSpasswordThe password defined during Database Instance creation
  5. Review the estimated cost, then click Deploy container to finish. Deploying a Serverless Container for the first time can take several minutes.

  6. 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.

Questions?

Visit our Help Center and find the answers to your most frequent questions.

Visit Help Center
No Results