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.
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
, with the platform branch dropdown set to Docker running on 64bit Amazon Linux 2
, and Platform version to the one that has a (Recommended)
tag.Upload your code
.Choose file
button with the Local File
radio button selected and upload the file you dowloaded at the very beginning of this guide (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:
Select Application Load Balancer
in the Load Balancer type if not already selected.
In the Processes section, select the default process and click on Actions
→ Edit.
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
After configuring this health check you can click on Save
at the bottom of the page.
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.
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.
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
)
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
block) is for picking the size of AWS instance you want to run. We recommend at least t3a.small
for most uses. You can always scale vertically by changing this configuration.EC2 key pair
(Security
block) is only needed if you want to SSH into your instance directly which is not recommended.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
should be left as None
.Engine
should be set to postgres
. Metabase also supports MySQL/Maria DB as backing databases, but only on a separate running RDS connected via environment variables. Trying to follow these steps and selecting MySQL will result in an error.Engine version
can simply be left on the default, which should be the latest version.Instance class
you can choose any size, but we recommend db.t2.small
or larger for production installs. Metabase is pretty efficient so there is no need to make this a big instance.Storage
to the default size.Username
and Password
for your database. We suggest you hold onto these credentials in a password manager, as they can be useful for things like backups or troubleshooting. These settings will be automatically made available to your Metabase instance.Retention setting
as Create snapshot
.Availability
we recommend the default value of Low (one AZ)
for most circumstances.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.
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.
Here’s each step:
Metabase
application.Application Versions
on the left nav (you can also choose Application Versions
from the dropdown at the top of the page).Upload
button on the upper right side of the listing.Choose File
and navigate to the file you just downloaded.Upload
button to upload the file.Deploy
button in the upper right side of the page.Deploy
button to begin the deployment.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.