Covered in this guide:
This quick launch setup is intended for testing purposes only, and is not intended for production use. We’ll focus on deploying Metabase with a single instance and the embedded H2 database with the following components:
If you would like a reliable, scalable and fully managed Metabase, please consider Metabase Cloud.
Download the Metabase Community Edition AWS source bundle file to upload to Elastic Beanstalk.
Metabase provides several pre-configured Elastic Beanstalk launch URLs to help you get started. Open one of the links below in a new tab to create an Elastic Beanstalk deployment with a few choices pre-filled. Then just follow the step-by-step instructions below to complete your installation.
Choose your region based on the proximity of your users, or if you have strict regulatory requirements that don’t let you spin up servers in other countries:
After clicking any launch URL, you should see a screen that looks like this:
Elastic Beanstalk is organized into Applications and Environments, so to get started we need to create a new application. You can customize the application name in case you need other than the default one.
Here’s where you can pick the environment name and the domain URL that you want to use for your Metabase instance. The environment name is simply the label you’re assigning to this instance of Metabase.
As for the domain URL, Feel free to get creative — just remember that the URL for your Metabase instance must be unique across all AWS Elastic Beanstalk deployments, so you’ll have to pick something that nobody else is already using. We often recommend something like mycompanyname-metabase. If you don’t care about the URL you can simply leave it to whatever Amazon inputs by default. Just be aware that this can’t be changed later.
mycompanyname-metabase
While most of the fields here will be correctly pre-filled by following the launch URL above, you’ll just need to do two things:
Docker
Docker running on 64bit Amazon Linux 2
(Recommended)
Upload your code
Choose file
Local File
metabase-aws-eb.zip
These settings will run the Metabase application using the official Metabase Docker image on Dockerhub.
Click Review and launch. You’ll be directed to a page to configure and launch your instance.
To set up your load balancer, you’ll need to enable enhanced health checks for your Elastic Beanstalk environment.
Click on the Edit link under the Load Balancer section as seen here:
Edit
Select Application Load Balancer in the Load Balancer type if not already selected.
Application Load Balancer
In the Processes section, select the default process and click on Actions → Edit.
Actions
The Health check path is where the Load balancer asks the application if its healthy so it can send traffic to. Set this path to /api/health
/api/health
After configuring this health check you can click on Save at the bottom of the page.
Save
A Virtual Private Cloud (VPC) is a virtual network you can use to isolate resources. Inside these VPC’s, you can create subnets, firewall rules, route tables and many more. It’s one of the foundational features of AWS, and you can learn more about it here.
You must configure your Application launch in a VPC, otherwise you’ll receive an error when creating it as AWS no longer supports launching instances outside VPC’s. To use a VPC, head to the Network section in the configuration and click on the Edit button.
Once inside the Network configuration, you need to select the VPC where the Application will exist. If you haven’t created a VPC, then AWS creates a default VPC per region that you can use.
default
You need to select at least 2 zones where the Load Balancer will balance the traffic, and at least 1 zone where the instance will exist. For the load balancer to send traffic to a living instance, there has to be a zone in common.
After configuring the zones for both the load balancer and the application, click Save at the bottom of the page.
Now go to the Capacity section and click Edit.
The only change you need to do here is to reduce the number of Instances from 4 (the default number) to 1, as we still haven’t created a centralized database where Metabase will save all of its configurations and will be using only the embedded H2 database which lives inside the Metabase container and is not recommended for production workloads as there will be no way to backup and maintain that database. When your instance is restarted for any reason you’ll lose all your Metabase data. If you are just doing a quick trial of Metabase that may be okay but otherwise you would like to start creating your database engine in RDS separately or deploy one a separate server. You can take a look at the Metabase at Scale article we wrote about how you can build redundant and scalable Metabase architectures.
Now click on Save at the bottom of the page and you can now click on Create App at the end of the Configuration page to start creating the environment.
Create App
This can take a little while depending on AWS. It’s not uncommon to see this take 10-15 minutes, so feel free to do something else and come back to check on it. What’s happening here is each part of the environment is being provisioned with AWS’s infrastructure automation functionality named CloudFormation (so you can see the detailed progress for the creation of your environment if you open CloudFormation in another tab).
When it’s all done you should see something like this:
To see your new Metabase instance, simply click on the link under your environment name in the top-left (it will end with .elasticbeanstalk.com)
.elasticbeanstalk.com
Now that you’ve installed Metabase, it’s time to set it up and connect it to your database.
There are many ways to customize your Elastic Beanstalk deployment, but commonly modified settings include:
Instance type
Instances
t3a.small
EC2 key pair
Security
When you hit the Create App button, AWS Elastic Beanstalk creates a CloudFormation template. This template means that the database will be created with the Elastic Beanstalk stack, and removed when you remove the application.
If you want to use a production-grade database based on best practices to persist all Metabase configurations you have to create one in RDS separately or manage your own on a separate server and then connect the Elastic Beanstalk instance/s with the RDS database through environment variables.
If you want to continue on this path and you know what you are doing, then: look for the Database configuration pane as below. and click on the Edit button.
The database settings screen will give you a number of options for your application database. Regarding individual settings, we recommend:
Snapshot
None
Engine
postgres
Engine version
Instance class
db.t2.small
Storage
Username
Password
Retention setting
Create snapshot
Availability
Low (one AZ)
Once you’ve entered a password and clicked Save, a message will appear saying that an RDS database should have at least 2 Avalability Zones selected, so you will have to go again to the Network options and select at least 2 Availability Zones for the Database. We recommend using the same Availability Zone as where the instance resides since you will be charged for cross-zone traffic otherwise.
If this is your first time creating an application for Elastic Beanstalk then you will be prompted to create a new IAM role for your launched application. We recommend simply leaving these choices to their defaults.
When you click Next a new tab will open in your browser and you will be prompted to create a new IAM role for use with Elastic Beanstalk. Again, just accept the defaults and click Allow at the bottom of the page.
Next
Allow
In order to configure environment variables for your Elastic Beanstalk deployment (e.g., to connect the deployment to a separate RDS database), click on your Metabase environment in Elastic Beanstak, go to Configuration → Software, and look for the Environment Properties in the bottom.
In the Environment Properties section, you’ll be able to set or change the variables for configuring your Metabase deployment.
For a simple way to keep tabs on your application, enter an email address in the Notifications block to get notifications about your deployment and any changes to your application.
Upgrading to the next version of Metabase is a very simple process where you will grab the latest published Elastic Beanstalk deployment file from Metabase and upload it to your Application Versions listing. From there it’s a couple clicks and you’re upgraded.
Application Versions
Here’s each step:
Metabase
Upload
Choose File
Deploy
Once a new version is deployed, you can safely delete the old Application Version. We recommend keeping at least one previous version available for a while in case you want to revert for any reason.