Metabase
Overview
Metabase is a popular open source business intelligence platform. You connect a database, ask questions with a point-and-click query builder or SQL, build dashboards and charts, and share them across your team.
This SecureAnyCloud image installs Metabase Open Source Edition, the official metabase.jar on the OpenJDK 21 JRE, behind an nginx reverse proxy. PostgreSQL serves as Metabase's own application database, because the embedded H2 default is unsuitable for production.
What you get:
- Metabase Open Source Edition 0.62 (
/opt/metabase/metabase.jar) on the OpenJDK 21 JRE, listening on 127.0.0.1:3000 - An nginx reverse proxy on
:80in front of the Metabase server, which is bound to loopback:3000 - PostgreSQL as the Metabase application database, bound to the loopback interface only
- Two dedicated Azure data disks, separate from the OS disk and re-provisioned with every VM: the PostgreSQL datadir at
/var/lib/postgresql, and the Metabase application, plugins and logs at/opt/metabase - An encryption key that protects, at rest, the connection details of the databases you connect. A unique
MB_ENCRYPTION_SECRET_KEYis generated on the first boot of every VM, so no two VMs share a key - A per-VM administrator account, created automatically on first boot with setup already completed, and recorded in /root/metabase-credentials.txt with mode 0600
metabase.service,postgresql.serviceandnginx.serviceas enabled, active systemd units- No connected data sources. You add your own after signing in
- 24/7 SecureAnyCloud support
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.
Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting size. Metabase runs on the JVM and benefits from memory, so scale up for more users or heavier queries.
Configure the network security group (NSG) to allow inbound 22/tcp from your management network. Also allow 80/tcp from the networks your users will reach Metabase on. For public exposure, put TLS in front of port 80 (see Enabling HTTPS).
You also need a database to analyse, such as PostgreSQL, MySQL, SQL Server or an Azure Database instance. Metabase includes a built-in Sample Database that you can explore first.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Metabase by SecureAnyCloud, and select Create.
On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).
Review the two dedicated data disks on the Disks tab, then select Review + create and Create.
First-boot initialisation takes approximately two to four minutes after the VM starts. During that time Metabase runs its database migrations, completes setup and creates your administrator account.
Step 2 - Deploy from the Azure CLI
Run the following commands from a shell where the Azure CLI is signed in. They accept the Marketplace terms, create the VM and open port 80.
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:metabase-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name metabase \
--image sac1647283583153:metabase-ubuntu-24-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name metabase --port 80 --priority 1010Step 3 - Connect to your VM
Connect over SSH as azureuser, using the key pair you supplied.
ssh azureuser@<vm-public-ip>Step 4 - Confirm the services are running
Check the three services and the health endpoint:
systemctl is-active metabase.service postgresql.service nginx.service curl -fsS http://127.0.0.1/api/healthAll three services report active and the health endpoint returns {"status":"ok"}. This confirms that the full stack is serving: nginx, the Metabase server and PostgreSQL.
Metabase is a JVM application. On the very first boot, allow a couple of minutes for migrations before the health endpoint reports ok.
Step 5 - Retrieve your administrator login
Read the credentials file with sudo. The administrator account is unique to your VM, and first boot writes it to a root-only file:
sudo cat /root/metabase-credentials.txtThe metabase.admin.email and metabase.admin.pass values are your sign-in. The file also records the per-VM PostgreSQL password.
Step 6 - Sign in for the first time
Browse to http://<vm-public-ip>/. First boot already completed the Metabase setup, so you go straight to the sign-in page.
Enter the email and password from /root/metabase-credentials.txt.
After you sign in, you reach the Metabase home page. It shows quick-start "x-rays", collections and your data sources in the sidebar.
Step 7 - Connect a data source
The image ships no connected data sources, although Metabase's built-in Sample Database is available to explore first. To analyse your own data, open the gear menu, choose Admin settings, then Databases, and select Add a database.
Metabase supports PostgreSQL, MySQL/MariaDB, SQL Server, Redshift, BigQuery, Snowflake, ClickHouse and more. For an Azure Database for PostgreSQL/MySQL instance or a database VM in the same VNet, enter its endpoint, database name and credentials. The credentials are encrypted at rest with this VM's unique key.
Metabase then syncs the schema so you can start querying.
Step 8 - Build questions and dashboards
Select + New to create a Question with the point-and-click query builder, or write SQL. Pick a visualization (table, line, bar, map and more) and save it to a collection.
Combine saved questions onto a Dashboard with filters for an at-a-glance view. Metabase's automatic x-rays generate a full dashboard from any table in one click.
To invite your team, open Admin settings, then People, then Invite someone.
Step 9 - Confirm the runtime and data tiers
The Metabase jar, plugins and logs live at /opt/metabase. The PostgreSQL datadir lives at /var/lib/postgresql. Each sits on its own dedicated Azure data disk. Confirm the Java version and both mounts:
java -version 2>&1 | head -1 findmnt -no SOURCE,SIZE,FSTYPE,TARGET /var/lib/postgresql findmnt -no SOURCE,SIZE,FSTYPE,TARGET /opt/metabaseEnabling HTTPS
For production, serve Metabase over HTTPS so that session tokens and data cannot be intercepted. The image ships with nginx, which certbot can configure automatically.
These commands assume a DNS record that points your fully qualified domain name at the VM's public IP:
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d metabase.your-domain.example \
--non-interactive --agree-tos -m you@your-domain.example \
--redirectAfter certbot finishes, set the site URL under Admin settings, then General, so Metabase generates correct links. Then restart the service with sudo systemctl restart metabase.
Backup and maintenance
Metabase keeps all of its state in its PostgreSQL application database on the dedicated data disk at /var/lib/postgresql. That state includes questions, dashboards, users, settings and connected-database definitions. Back it up regularly:
sudo -u postgres pg_dump metabaseapp > /tmp/metabase-appdb-$(date +%F).sqlCopy the dump to Azure Blob Storage or another object store. Alternatively, snapshot the two data disks in Azure for coordinated point-in-time backups.
Keep the OS patched with sudo apt update && sudo apt upgrade.
To upgrade Metabase itself, back up first. Then replace /opt/metabase/metabase.jar with a newer release and restart with sudo systemctl restart metabase. Metabase migrates the application database automatically.
Support
This image comes with 24/7 SecureAnyCloud support. Contact us by email and chat for help with deployment, data source configuration, upgrades, TLS termination and database administration. Email sales@secureanycloud.com.
For general Metabase questions, see the documentation at https://www.metabase.com/docs/latest/. Metabase is a trademark of Metabase, Inc. All product and company names are trademarks or registered trademarks of their respective holders. Their use here does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch Metabase on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Metabase is a popular open source business intelligence platform. You connect a database, ask questions with a point-and-click query builder or SQL, build dashboards and charts, and share them across your team.
This SecureAnyCloud image runs Metabase behind an nginx reverse proxy. PostgreSQL serves as Metabase's own application database for its metadata, because the embedded H2 default is unsuitable for production.
What you get:
- The Metabase server listening on
127.0.0.1:3000, reached through nginx on port 80 (and 443 once you add TLS) - PostgreSQL as the application database, bound to the loopback interface only
- An encryption key that protects, at rest, the connection details of the databases you connect. It is generated fresh on the first boot of every deployed instance, so no two instances share a key
- A single administrator account, created automatically on first boot with setup already completed, and written to
/root/metabase-credentials.txtwith mode 0600 - No connected data sources. You add your own after signing in
Prerequisites
Before you deploy this image, you need:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group that allows inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users will reach Metabase on
- The AWS CLI (version 2) installed locally, if you plan to deploy from the command line
- A database to analyse, such as PostgreSQL, MySQL, Redshift, BigQuery, Snowflake or an Amazon RDS instance. Metabase includes a built-in Sample Database that you can explore first
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Metabase. Select the SecureAnyCloud listing, choose Select, then choose Continue on the subscription summary.
Pick an instance type of m5.large or larger. Metabase runs on the JVM and benefits from memory. Choose your EC2 key pair under Key pair (login).
Under Network settings, select your VPC and subnet. Create or select a security group that allows inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users use. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialisation takes approximately two to three minutes after the instance state becomes Running. During that time Metabase runs its database migrations and completes setup.
Launch the instance from the AWS CLI
Run the following command to launch an instance from the SecureAnyCloud Metabase Marketplace AMI into an existing subnet and security group.
Replace <ami-id> with the AMI ID shown on the Marketplace listing. Replace <key-name> with your EC2 key pair name and <subnet-id> with your subnet ID. Replace <security-group-id> with a security group that opens ports 22, 80 and 443 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":30,"VolumeType":"gp3"}}]' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=metabase-01}]'On success, the command prints a JSON document. Note the instance ID. Once the instance is running, retrieve its public address withaws ec2 describe-instances --instance-ids <instance-id> --query "Reservations[].Instances[].PublicIpAddress" --output text.
Connect and retrieve the administrator login
Connect over SSH with the key pair you selected and the public IP address from Step 2. The SSH login user depends on the AMI variant you launched. For Metabase 0.62 on Ubuntu 24.04, the login user is ubuntu.
The first-boot service runs before the SSH daemon is ready, so the credentials file is always in place when you log in for the first time.
ssh <login-user>@<public-ip>
sudo cat /root/metabase-credentials.txtThe plain text file contains the Metabase URL, the administrator email (admin@example.com) and the password.
From the same SSH session, confirm that the deployment is healthy. The health endpoint is open:
curl -fsS http://127.0.0.1/api/health{"status":"ok"}A {"status":"ok"} response confirms that the full stack is serving: nginx, the Metabase server and PostgreSQL.
Sign in for the first time
Browse to http://<public-ip>/. First boot already completed the Metabase setup, so you go straight to the sign-in page.
Enter the email and password from /root/metabase-credentials.txt.
After you sign in, you reach the Metabase home page. It shows quick-start "x-rays", collections and your data sources in the sidebar.
Connect a data source
The image ships no connected data sources, although Metabase's built-in Sample Database is available to explore first. To analyse your own data, open the gear menu, choose Admin settings, then Databases, and select Add a database.
Metabase supports PostgreSQL, MySQL/MariaDB, SQL Server, Redshift, BigQuery, Snowflake, ClickHouse and more. For an Amazon RDS or Redshift instance in the same VPC, enter its endpoint, database name and credentials. The credentials are encrypted at rest with this instance's unique key.
Metabase then syncs the schema so you can start querying.
Build questions and dashboards
Select + New to create a Question with the point-and-click query builder, or write SQL. Pick a visualization (table, line, bar, map and more) and save it to a collection.
Combine saved questions onto a Dashboard with filters for an at-a-glance view. Metabase's automatic x-rays generate a full dashboard from any table in one click.
Add users
Invite your team from Admin settings, then People, then Invite someone.
Configure an email server under Admin settings, then Email, for example with Amazon SES. This delivers invitations and dashboard subscriptions.
You can organise users into groups and control which databases and collections each group can access.
Enable HTTPS with Let's Encrypt
For any production deployment, serve Metabase over HTTPS so that session tokens and data cannot be intercepted. The image ships with nginx, which certbot can configure automatically.
These commands assume a DNS record that points your fully qualified domain name at the instance's public IP address.
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d metabase.your-domain.example \
--non-interactive --agree-tos -m you@your-domain.example \
--redirectAfter certbot finishes, set the site URL so Metabase generates correct links. You can change it under Admin settings, then General. Then restart the service with sudo systemctl restart metabase.
Backups and maintenance
Metabase keeps all of its state in its PostgreSQL application database. That state includes questions, dashboards, users, settings and connected-database definitions. Back it up regularly:
sudo -u postgres pg_dump metabaseapp > <backup-dir>/metabase-appdb-$(date +%F).sqlCopy the dump to an Amazon S3 bucket or another object store. Because the application database is on its own EBS volume, you can also take coordinated EBS snapshots.
Ubuntu's unattended-upgrades is enabled by default for kernel and package updates.
To upgrade Metabase itself, back up first. Then replace /opt/metabase/metabase.jar with a newer release and restart. Metabase migrates the application database automatically. See https://www.metabase.com/docs/latest/.
Scale beyond a single instance
For larger deployments, decouple Metabase from the single-instance pattern:
- Move the application database to Amazon RDS for PostgreSQL and update
MB_DB_*in/etc/metabase.env - Put the web tier behind an Application Load Balancer and run multiple Metabase instances against the shared application database
- Serve static assets through Amazon CloudFront
The official Metabase documentation covers each of these at https://www.metabase.com/docs/latest/.
Support
SecureAnyCloud provides 24/7/365 expert technical support for this image, with a guaranteed response within 24 hours and a one-hour average for critical issues. Email sales@secureanycloud.com.
For general Metabase questions, see the documentation at https://www.metabase.com/docs/latest/. Metabase is a trademark of Metabase, Inc. Its use here is nominative and does not imply affiliation or endorsement.
Deploy on AWS
Launch Metabase on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com