Can you run multiple Metabase instances using a single metabase.jar file?


I'm pretty new to Metabase and the 'Java ecosystem' in general.

I want to run multiple instances of Metabase using the jar file method. At face value this seems to work fine passing each instance various params at startup.
java -DMB_JETTY_PORT={redacted} -DMB_JETTY_SSL_PORT={redacted} -DMB_DB_CONNECTION_URI="postgres://{redacted}?user={redacted}&password={redacted}" -jar J:\SomeFolder\Runtime\metabase.jar

My question is: Is it safe to assume that the different instances will be fully isolated from each other? Is Metabase tested for this? Is it just a feature of the JVM/ Java that these will be isolated from each other?

My alternative [I think] is to use different jar files. That Smells a bit to me and would make maintenance updates of the metabase jar file a bit more of a pain.

Thanks in advance for any advice offered.

P.S. Thanks to this community for getting me this far :slight_smile:

1 Like

All those in the same server?


I have the Metabase application running on a server with a Postgres db server on the side.


Same need here. I'm curious about this possibility...

So you want to run the jar, let’s say, 3 times, on the same server all connected to the same app db?


No. Each instance of Metabase will at the first pass have its own Metabase database. It seems to work ok but I'm just wondering about resources potentially being shared between the different instances of Metabase. I'm a complete novice when it comes to Java and its runtime environment and process isolation. I was looking around the internet and people seemed to be saying that each instance should use its own JVM (or similar terminology) which would enforce isolation but the only true answer would need to take into account the opinion of the jar file developer. Hence I'm here.

Thanks for taking the time to discuss this.

Got it, so yeah, every instance will be isolated on its own Java virtual machine (which is not the same as an actual virtual machine). You need to consider launching the Java process with the “-xms” and “-xmx” flags so each process does not eat from the others RAM


Thanks Luiggi. That -xms flag is a new one on me. I'll go have a look at that, thanks.

I'm guessing that becomes something like:
java -xms -xmx -DMB_JETTY_PORT={redacted} -DMB_JETTY_SSL_PORT={redacted} -DMB_DB_CONNECTION_URI="postgres://{redacted}?user={redacted}&password={redacted}" -jar J:\SomeFolder\Runtime\metabase.jar

1 Like

For any other Java noobs like me finding this thread. For some -xms/ -xmx info why look further than SO.

Case closed. Thanks @Luiggi

1 Like