I have Mastodon running on a VPS running Debian 11. Now I would like to add a Lemmy instance on the same server. I tried using the from scratch method from Lemmy documentation, but ran into errors that likely stemmed from minor version incompatibilities of the dependencies. I tried using the Lemmy easy deploy script but it wants to bind all traffic on port 443 for Lemmy which would break my Mastodon install. Has anyone managed to get Lemmy and Mastodon running on the same box, and if so, can you share any details of your setup?
You need a reverse proxy like nginx or traefik. Your mastodon server is using the web ports. Lemmy also wants to use the same ports. Obviously the can’t both use them.
The solution is to let neither use the ports and set them up on some other ports.
The reverse proxy is then set up as your main “web server”. It will then look at every request coming in and based on the domain name or url requested redirect (or rather forward or proxy) the request to the correct service… mastadon or Lemmy.
I run dozens of services on the same server. And use traefik to sit in front and manage it all.
I have reverse proxy configured for Mastodo using Nginx. It’s the Lemmy Easy Deploy script trying to bind all traffic on port 443 where I run into problems.
This is what containers were made for my friend. I’m sure that both Lemmy and Mastodon have Docker images available. If not you can always run your installs in LXC containers instead.
I just got it working. I used a Docker install for Lemmy but not for Mastodon and setup reverse proxy manually. I still have some fine tuning to do, but it works! Woot!
I would personally recommend putting them both in Docker containers, but I’m glad it’s working for you.
Thanks for the suggestion. What would be the benefit of switching to a docker install of Mastodon?
Basically the whole point of docker is that it keeps all the fiddly junk involved in actually running an application separated off into its own little box where it can’t affect the host system. So by taking one of those applications and putting it directly on the host system you’re sort of undoing all that.
The idea is that the docker host basically shouldn’t do anything other than run docker itself. That way there’s minimal chance of anything getting screwy. Also using docker installs for all your critical apps means that you can use Watchtower to auto update them, which is a nice bonus.
Thanks for the perspective! I am a reluctant newcomer to Docker so I appreciate it. Time for me to get with the times and embrace Docker since that’s the most popular installation method for many of my favorite self hosted platforms these days. It might take a while for me to really get used to it though. Since I have this setup and working it will probably remain as is, but I’ll make a point to do a pure Docker setup on a similar build in the future.
Kinda tangential, but have you tried Kbin? Handles both Mastodon and Lemmy really well from a user standpoint.
Interesting point. I hadn’t given that any consideration but if my Mastodon/Lemmy plans don’t work out I might give it a shot.
Thanks for talking through it with me, everyone. I got it working with a Docker compose install of Lemmy and a non-Docker Mastodon install. Reverse proxy was configured manually in nginx. Mastodon.fdr8.us and Lemmy.fdr8.us are now live! I have some fine tuning to do still and a lot of setup, but I’m happy that they are working. Cheers!