How to run Metabase on Dokku

An open source analytics dashboard on an open source platform-as-a-service

Metabase is

the easy, open source way for everyone in your company to ask questions and learn from data.

Dokku is:

The smallest PaaS implementation you’ve ever seen
Docker powered mini-Heroku in around 200 lines of Bash

Metabase provide some one-click setups for Heroku, AWS, and Docker. But not Dokku!

Setting it up on Dokku is super easy though, if you’ve already got Dokku set up.

mkdir metabase
cd metabase
curl http://downloads.metabase.com/v0.13.1/metabase.jar > ./metabase.jar #download the .jar version of metabase
# Check http://www.metabase.com/ for latest verison
echo "web: java -jar metabase.jar" > Procfile 
# makes a Procfile so Dokku knows how to run the jar
git init #you use Git to deploy to Dokku
git add metabase.jar
git add Procfile
git commit -m "Making metabase run on Dokku"
ssh dokku@where.your.dokku.is.com apps:create metabase #make a new dokku app
ssh dokku@where.your.dokku.is.com config:set metabase MB_JETTY_PORT=5000
# Metabase by default serves on port 3000; Dokku expects 5000 so we set that environment variable to make both happy
git remote add dokku dokku@where.your.dokku.is.com:metabase
git push dokku master #deploy metabase

And that should do it! Check

ssh dokku@where.your.dokku.is.com logs metabase

To see if it deploys okay. It’ll take a minute or so to initialise.

Then browse to: http://metabase.where.your.dokku.is.com and off you go :)

If you have problems with Java, just

ssh root@where.your.dokku.is.com

and then run

java -version

to see what JVM you have. If it doesn’t look groovy…

apt-get install openjdk-8-jre