Metabase and Digital Ocean

Hi community,

I’d like to install Metabase on a Digital Ocean droplet.

I believe I can save cost as compared to my AWS installation which currently runs me almost $40 p.m.

Is there any advice/guide out there?

thank you!

They look very cheap, I’d be interesting in hearing of your experience with them.
Trustpilot reviews don’t look great :
https://uk.trustpilot.com/review/digitalocean.com

@AndrewMBaines - Wow, I’ve never read the Trustpilot reviews before.
But in general - I like them. Simple to use, good pricing, my site has not been down … yet.
For me the simplicity is the biggest selling point, over something like AWS

Not sure if this is helpful, but I run my demo setup on Azure using an Ubuntu VM. 1 VCPU and 2GB RAM have been plenty so far. Costs about £13/$15 per month.
Closest equivalent on Digital Ocean is 2VCPU and 2GB RAM for about the same.

@AndrewMBaines - That’s very helpful :slight_smile:
I’m happy to use Azure instead … but I’m not a developer. So would you be able to point me to some stepwise instructions? Thanks!

It was the first time I’d used Linux without a UI (just command line), so my documentation is very poor. Wasn’t helped by Metabase not supporting the latest version of Java at the time (now fixed).
My approach was to work out what needed to be installed, then use search engine to find out how to do it.
Great thing about Linux is how the dependencies are installed for you. Biggest pain was making the jar into a service to run without being logged in.

Hi Andrew!
What can you say about it? How did you set this service?
I´m thinking about use the same aproach.

Thanks.

I started here:


As I said, my notes are awful. I need to do again and document properly. My customers are all on Windows at the mometn,

There’s an official guide to setup Metabase as a service on Debian (the core behind Ubuntu)

I would definitely not recommend this guide. Init scripts are tricky to maintain and use. Personally I recommend using systemd, it is simpler to configure and maintain (for me at least).

@AndrewMBaines I created a pull request to update the running metabase on debian guide. It’s based on my own personal metabase config I’m using on the production debian server here at work. I’m not a linux expert by any means, would you mind looking it over for any issues?

Thanks!

I’m still in early days of working with Linux too, but I’d love to take a look. How do I download the guide? I know github is very clever, but from a UI perspective it’s one down from Windows 8.

@AndrewMBaines
I’m guessing you’re asking to for @omegadeep10’s pull?
When you go to the pull, click the Files Changed tab, click the View File button.
https://github.com/metabase/metabase/blob/8a3cb2b043dd5f5aec3e7bd5063d422d84cbd5e5/docs/operations-guide/running-metabase-on-debian.md

As a person who has been using digital ocean for close to 5 years, reading the trustpilot reviews is a little surprising. The numbers make me doubt the credibility of trustpilot but at the same time, some of the reviews appear to be real issues.

If i ever had some of the issues posted, I wouldn’t give D.O. a second chance. There are some problems that are inexcusable for a data company. Some of the problems I would have to experience or see confirmation from a D.O. representative before I believed they happened exactly as posted. Not saying they could not happen, just that it seems unlikely considering how many servers I’ve spun up there and the level of support I’ve received even when at the $5/mo level.

All that aside, no matter what, your data and setup should be backed up in a manner that dropping D.O. Linode, AWS, Google Cloud, etc should be able to be done in a single day (assuming the worst TTL for Domain changes). Maybe longer on more complex setups but the more complex it is, i feel like the more likely the fail-over should be spread across more than one hosting company instead of just more than one region. I’f all my D.O. instances vanished right now, clones of all data, server scripts, and settings live somewhere else. I randomly test spinning up somewhere else based on my backups when I can.

Something else to keep in mind. A common thing is for people to recommend some off-brand company over a bigger competitor. Later a little research shows the off-brand is running inside, white-labeled on the larger competitors hardware. So look out for that.

Hi akash47,

Digital Ocean supports Docker. You could install Metabase as Docker Image.
https://hub.docker.com/r/metabase/metabase/

Thanks everyone,

I’ve managed to install it on DO with the following command:

docker run -d -p 3000:3000 --rm   -e “MB_DB_TYPE=postgres”   -e “MB_DB_DBNAME=metabase”   -e “MB_DB_PORT=5432”   -e “MB_DB_USER=mydbname”   -e “MB_DB_PASS=mypassword”   -e “MB_DB_HOST=postgres-db”   -e "JAVA_TIMEZONE=Asia/Calcutta"  --add-host postgres-db:xxx.xxx.xxx.xxx --name metabase metabase/metabase

and, it works fine.

But the data isn’t persistent.

If I run
docker stop metabase
I lose all my configuration.

Reading this, I thought my configurations on Metabase would remain

Any thoughts?

@akash47
It should persist.
Check the Metabase log to see which database it uses when starting and other details.
Is your Postgres also running in Docker?

Yes - Postgres is also running in Docker.

Checked the logs. You’re right - there is no mention of anything other than the H2 database.
So now I’m stumped :confused:

@akash47
I think I see the problem. You’re using and around the parameters, when you should be using regular ", just like you have around JAVA_TIMEZONE=Asia/Calcutta
Try this:

docker run -d -p 3000:3000 --rm -e "MB_DB_TYPE=postgres" -e "MB_DB_DBNAME=metabase" -e "MB_DB_PORT=5432" -e "MB_DB_USER=mydbname" -e "MB_DB_PASS=mypassword" -e "MB_DB_HOST=postgres-db" -e "JAVA_TIMEZONE=Asia/Calcutta" --add-host postgres-db:xxx.xxx.xxx.xxx --name metabase metabase/metabase

Thanks @flamber - that fixed it :slight_smile:

Another follow up question:

  • I’ve managed to install Metabase using a Docker container on a DO Droplet
  • How do I enable SSL connections to this to secure it up

I think once I’ve done that - I guess I can all it production ready

@akash47 The usual way to use SSL with Docker containers is to run an SSL reverse proxy in a separate container. You have a few options:

or

https://docs.traefik.io/

I’m sure there are others. Search for “docker ssl reverse proxy”.