July 18, 2023
Justin Ellingwood
@jmellingwood
Metabase is an open-source business intelligence platform that can connect with many different data sources to offer insight into your organization's key functions. Metabase makes it possible to integrate all of your data into a single platform and offer data exploration tools to teams with varying levels of technical expertise. You can create dashboards to visualize changes, create models to simplify access to information, and run saved or ad hoc queries to find the data that matters most to you.
In this guide, we will show you how to set up a new Metabase instance on Koyeb in order begin gathering insights from your organization's data. Metabase provides a Docker image that we can use to get the platform up and running without needing to manage its Java runtime and dependencies directly. We will use Neon to provision a PostgreSQL database where Metabase can store information about users, questions, dashboards, and more. Deploying with an external database allows Metabase to scale horizontally and redeploy seamlessly without losing data.
To follow along with this guide, you will need to create accounts with the following services:
We will go over how to set up the resources we need from each of the above providers throughout the guide.
Before we can deploy Metabase, we need to provision a database where it can store its data. Metabase can use a number of different backing databases, including a local H2 database. Since we want our data to persist across deployments and be available from any number of application instances, we will opt for an external PostgreSQL database provisioned on Neon.
To create a new PostgreSQL database, log into your Neon account. In the Neon console, follow these steps to create a new PostgreSQL database:
metabase
for this guide.The following screen will show the connection details for your new database. Since Metabase is written in Java, in the drop-down menu, select Java. Copy the JDBC connection URI displayed so that we can use it later when we configure Metabase. It should look similar to this:
jdbc:postgresql://<NEON_HOST_PREFIX>.neon.tech/neondb?ssl=require&user=<NEON_USER>&password=<DB_PASSWORD>
Now we have the database connection URI, we can deploy Metabase to Koyeb.
Begin by logging into your Koyeb account. Follow these steps to deploy Metabase to the platform:
docker.io/metabase/metabase
. Leave the Tag blank to pull the latest image or select the image tag you'd like to deploy.PORT
environment variable and the Port
field of the Expose your service section to Metabase's default port: 3000
.MB_DB_CONNECTION_URI
and paste the JDBC connection URI you copied from Neon as the value. Next, add a variable called JAVA_OPTS
with a value of -Xmx1g
to set the Java heap size to 1GB of memory.Koyeb will pull the Metabase Docker image from Docker Hub and start a container based from it based on your configuration. The Metabase process will start up, connect to and initialize the database, and prepare for its first run.
To access your new Metabase instance, visit your Koyeb Service's subdomain (you can find this on your Service's page). It will have the following format:
https://<YOUR_APP_NAME>-<KOYEB_ORG_NAME>.koyeb.app
You will be greeted by the Metabase setup page:
Click Let's get started to begin initial account creation process.
On the next page, select your preferred language:
Click Next to continue.
Fill out the information for your new user account:
Click Next to move on.
The next section let's you select what type of data you want to connect with Metabase and enter the associated connection details:
For now, just click I'll add my data later link to continue.
Select whether you want to send anonymous usage data back to Metabase:
Make your selection and click Finish to wrap up.
Before you continue, you'll have the option to sign up for the Metabase newsletter:
Click Subscribe if you'd like updates. Click Take me to Metabase to access your new Metabase instance.
You will be taken to Metabase's primary dashboard:
Click on any of the sample "x-rays" to view different examples of how to use Metabase as applied to the included sample database:
To see the sample database itself, click Browse data under the DATA heading in the side navigation bar.
You can add additional data sources at any time by clicking the Add your own data item in the sidebar.
In this guide, we covered how to deploy Metabase to Koyeb with their default Docker container. We used a PostgreSQL database provisioned through Neon to store the platform's information about users, views, questions, and other data. This configuration allows us to easily update the application and scale out as our requirements change.
As you add different data sources to your Metabase instance, check in with the application logs on the Deployment page in the Koyeb control panel to make sure everything is running smoothly. If you need additional resources, you can easily scale out your Deployment to better serve your users.
Koyeb is a developer-friendly serverless platform to deploy any apps globally.
Start for freeDeploy 2 services for free and enjoy our predictable pricing as you grow
Get up and running in 5 minutes