Skip to content

Metabase on the Ametnes Platform#

This tutorial explains how to provision a Metabase data service on the Ametnes Platform. Running Metabase on the platform keeps your dashboards and analytics data inside your own private infrastructure — a common requirement after Metabase's recent security incident.

Prerequisites#

  • An Ametnes Platform account.
  • A configured Data Service Location.

Provision Metabase on Ametnes Platform#

  1. Sign in to the Ametnes Platform console.
  2. Click New Resource.
  3. Enter:
  4. Name: a unique name for your Metabase service.
  5. Resource Kind: metabase.
  6. Tier: choose a preset tier size that matches your expected dashboard and query load.
  7. Storage: choose capacity for Metabase's bundled application database.
  8. Select your Data Service Location.
  9. Click Create.
  10. Save the generated connection details, including the URL.

Deploying data services at scale is easier with the Ametnes Cloud Terraform provider.

Create an API token

In your Ametnes Cloud account:

  1. Navigate to Users.
  2. Click Edit on your user.
  3. Click Get User Token and a user token will be generated for you.
  4. Keep the generated token in a secure place, as it will not be shown again.

Install Terraform

Follow the instructions here to install Terraform on your computer.

Create your project

Add these files to an empty folder on your workstation.

Set up the variables

variables.tf
variable "token" {
  type = string
  description = "The Ametnes Cloud API token to use. Create one in the Ametnes Cloud console for your registered email."
}

variable "username" {
  type = string
  description = "Your Ametnes Cloud registered email address."
}

variable "project" {
  type = string
  description = "The project you'd like to create your resources in."
  default = "Default"
}

Add your API key secrets

secrets.auto.tfvars
username = "Your.Email@domain.com"
token = "YourApiToken"

Define your resources

main.tf
terraform {
  required_providers {
    ametnes = {
      source  = "ametnes.com/cloud/ametnes"
    }
  }
}

# Init and create the provider.
provider "ametnes" {
  token    = var.token
  username = var.username
}

# Read the location.
data "ametnes_location" "location" {
  name = "Your Data Service Location"
  code = "DSL1"
}

# Read the project that will host all your resources.
data "ametnes_project" "project" {
  name = var.project
}

# Create a Metabase service resource.
resource "ametnes_service" "metabase" {
  name        = "MetabaseService"
  project     = data.ametnes_project.project.id
  location    = data.ametnes_location.location.id
  kind        = "metabase:0.61"
  description = "Metabase data service"
  capacity {
    storage = 10
  }
  config = {
    architecture = "Starter"
  }
}

output "service_connections" {
  value = ametnes_service.metabase.connections
}

The architecture config option selects the preset tier size (Starter, Small, Basic, Medium, Large, XLarge, 2xlarge, 3xlarge, or 4xlarge) and capacity.storage sizes Metabase's bundled application database. You do not need to attach a separate Network Access resource: it is created for you automatically.

Deploy your Terraform resources

  1. Run terraform init.
  2. Run terraform plan to see the resources that will be created.
  3. Run terraform apply -auto-approve.
  4. Once Terraform finishes, the service_connections output contains the endpoint (URL) of your Metabase service.

Note

Metabase is deployed inside your private environment and is only accessible within your internal network.

Open Metabase#

  1. Open the Metabase URL in a browser (from your resource details in the console, or from the service_connections output if you used Terraform).
  2. On first launch, Metabase shows a setup page where you create your admin account: enter your name, email address, and a password.
  3. Continue through the remaining steps (language, timezone, and usage-data preferences) until you reach the Metabase home screen.

Connect Metabase to your data#

Add your databases under SettingsAdminDatabasesAdd database, then build questions and dashboards against them.

Validation checklist#

  • Metabase resource status is online in Ametnes Platform.
  • You can open the Metabase URL and complete first-time setup.
  • You can sign in and reach the Metabase home screen.