Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions tutorials/metabase-postgre-containers-private-networks/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Deploying Metabase in a Private Network using Serverless Containers
description: This page shows you how to deploy Metabase in a Private Network using Serverless Containers.
products:
- serverless-containers
- postgresql-and-mysql
- private-networks
- vpc
tags: deploy metabase virtual private cloud private networks serverless containers
dates:
validation: 2025-08-07
posted: 2025-08-07
validation_frequency: 12
---

import Requirements from '@macros/iam/requirements.mdx'

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.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- Created a [Private Network](/vpc/how-to/create-private-network/) within a dedicated [VPC](/vpc/how-to/create-vpc/)

## Creating a PostgreSQL Database Instance

1. [Create a Database Instance](/classic-hosting/how-to/create-postgresql-database/) 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](/serverless-containers/how-to/create-manage-delete-containers-namespace/).

2. [Create a Serverless Container](/serverless-containers/how-to/deploy-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**:

| 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` |

4. Add the following **secret**:

| Key | Value | Comment |
|-----------------|-------------|---------------------------------------------------------------------------------------------------------------|
| `MB_DB_PASS` | `password` | The 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](https://www.metabase.com/learn/metabase-basics/getting-started/index) 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](https://github.com/scaleway/serverless-examples/tree/main/containers/vpc-metabase) for more information.