DEV Community

Cover image for Self-hosted business intelligence with Metabase

Posted on

Self-hosted business intelligence with Metabase

It is always useful to know how your business or projects are doing and for that, there are a bunch of tools available such as Excel spreadsheets, Google DataStudio, Apache Superset, etc. I personally am a fan of Metabase as it is the easiest to deploy and use. When paired with the right technologies, this setup becomes trivial to any small or large organizations.

Main benefits of self-hosting Metabase (other tools as well):

  • Performance - compared to Cloud VMs your own hardware will not be throttled even when it runs heavy queries.
  • Costs - hardware like Intel NUC (or new ones from AMD) pay for themselves not in years but in months. I have mine for more than 2 years and it's been fantastic little helper.
  • Privacy - since you need to supply connection strings to your detabase, it's much better to do it on your own hardware where you control the risks.
  • Stability - managed instances can be updated at any time and can break your setup. This happened to us :)

In this article, we will use a setup that works exactly the same way on both an Intel NUC (for some of my projects) and on a large VM that is managed by a VMware.


  • Webhook Relay account - will be used to expose the Metabase to the internet, so we can access it.
  • Synpse account - a lightweight and fantastic platform to manage and run software on your own hardware. Offers management of up to 5 devices free of charge.

1. Install Synpse into your server/machine

Once you log into Synpse Cloud, select your project and then head to the "Devices" page. From there you will be able to find the auto-generated command that you need to run on the device to add it to your project.

There are multiple ways to do it however initially you can just SSH into the machine via local network. Once you run the command, after a few seconds (depends on your internet speed) you should see the magic happen and device appear in your "Devices" page in Synpse :)

2. Create a Webhook Relay tunnel for your Metabase app

Our Metabase deployment will need to be reachable from outside so we can actually view reports. For this, we are creating a Webhook Relay tunnel that will be established by a webhookrelayd container.

Go to your page and create a new tunnel with these details:

  • name: 'whr-metabase' (webhookrelayd agent will need to know which tunnel to use)
  • destination: 'http://metabase:3000' (metabase is reachable using container's name)

3. Get your access token key and secret

Head to the tokens page here and create a new pair. Save the key and secret before closing the window.

Go to the secrets page in Synpse and create both relayKey and relaySecret secrets:

Image description

4. Deploy Metabase via Synpse

Last step is to create a Synpse application.

name: metabase
description: metabase + WHR
  type: Conditional
    type: controller
    - name: metabase
      image: metabase/metabase:latest
        - /data/metabase:/metabase-data
        - name: MB_DB_FILE
          value: /metabase-data/metabase.db
          value: "false"
    - name: relayd
      image: webhookrelay/webhookrelayd:1
        - --mode
        - tunnel
        - -t
        - whr-metabase # <--- if you have chosen a different name for the tunnel, change it here too
        - name: RELAY_KEY
          fromSecret: relayKey
        - name: RELAY_SECRET
          fromSecret: relaySecret
Enter fullscreen mode Exit fullscreen mode

Once deployed, use your tunnel URL to access it. You can also configure Google OAuth to make the login easier, however that's out of scope in this article.


Originally published on

Top comments (0)