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.
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 :)
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
Go to your https://my.webhookrelay.com/tunnels page and create a new tunnel with these details:
- name: 'whr-metabase' (
webhookrelaydagent will need to know which tunnel to use)
- destination: 'http://metabase:3000' (metabase is reachable using container's name)
Head to the tokens page here https://my.webhookrelay.com/tokens and create a new pair. Save the key and secret before closing the window.
Go to the secrets page in Synpse and create both
Last step is to create a Synpse application.
description: metabase + WHR
- name: metabase
- name: MB_DB_FILE
- name: MB_REDIRECT_ALL_REQUESTS_TO_HTTPS
- name: relayd
- whr-metabase # <--- if you have chosen a different name for the tunnel, change it here too
- name: RELAY_KEY
- name: RELAY_SECRET
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 https://webhookrelay.com/blog/2021/11/11/setting-up-selfhosted-metabase/