# Run Metabase with Dokku

# Run Metabase with Dokku

> How to deploy Metabase (open-source BI tool) to production using Dokku PaaS (open-source Heroku alternative).

Source: https://okhlopkov.com/run-metabase-with-dokku/

How to deploy Metabase (open-source BI tool) to production using Dokku PaaS (open-source Heroku alternative). Step-by-step guide Install Dokku Imagine that you have already rent a server for your project. I use Digital Ocean droplets (this is my referral link with a $100 deposit for new users). Id' suggest having at least 2CPU and 2Gb RAM on your server. The latest Dokku installation one-liner can be found on their official website but I'd suggest reading my blog post where I cover more details. Install Metabase All cool open-source projects must have a prebuilt docker image and environment variables support. This will drastically improve the onboarding of new users. — Dan Okhlopkov 🍪 (@danokhlopkov) August 16, 2021 Since Metabase has its Docker image with the latest version which supports environment variables, all we need is to create a Dokku app from Docker image with all proper configs: https://twitter.com/danokhlopkov/status/1427222749626486785 dokku apps:create metabase For production deployment, you need to switch from the default database to Postgres. Create &amp; link Postgres DB to the Dokku app: dokku postgres:create metabase dokku postgres:link metabase metabase Now let's link Postgres the way Metabase will understand. Take POSTGRES_URL from the output above and insert it to the command below: dokku config:set metabase MB_DB_TYPE=postgres MB_DB_CONNECTION_URI=&lt;your postgres url&gt; Metabase uses 3000 port as default. Let's tell Dokku to use it for its internal Nginx routing: dokku proxy:set metabase http:80:3000 And finally, deploy Metabase from the official docker image: dokku git:from-image metabase metabase/metabase:latest If you want to attach a domain and use HTTPS from letsencrypt : dokku domains:set metabase YOURDOMAIN.com dokku letsencrypt:enable metabase Now just open YOURDOMAIN.COM in the browser and finish Metabase setup 🥳 Thanks for reading! You may ask me why I do all these tutorials? Well, since I was banned from Instagram I need someplace to publish my selfies. And of course: I create these tutorials for myself in the future. Because I just don’t want to remember all the CLI stuff - I just want to copy-paste from trusted source. https://t.co/cpGeN1EQiR — Dan Okhlopkov 🍪 (@danokhlopkov) July 31, 2021

