How can I have multiple installations on the same server?

I’m trying to have more than one installation on the same server. I want to have everything separeted, both Mongo and RocketChat. Installing the first instance with snap is really easy, I just followed this documentation:

The problem is having the second instance, as I need different ports for mongo and Rocket Chat. Near the end on that same page, I found this:

Changing the Port of RocketChat works fine, but changing MongoDB’s port fails as there is no Mongo running there. How can I make snap install mongo on a different port?

I will also need after successfully having two instances running together, to enable HTTPS on both, but I’m currently stuck at this step. If you can think of any other solution for my problem, even if it’s without using snap, I would really appreciate it.


This sounds like a job for docker. You can do all that there very easily.