Anyone hosting Lemmy and Mastodon on the same server?
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.
Don't use that silly script. Easiest is to use the docker compose method and modify the compose file to remove the nginx container since you already have nginx. Then once you have lemmy's containers running, add config to nginx to point to the ports lemmy/lemmy ui listen on
I suggest using vhosts. You can for example run Lemmy on port 8001 and Mastodon on port 8002 (both should be bound to 127.0.0.1 without HTTPS). Then you get two domain names pointing at the same server. Then you install nginx on your server, as your actual web server, and you configure it so requests for lemmy.trinitytek.com gets proxied to lemmy and mastodon.trinitytek.com gets proxied to mastodon
I found it easiest to get them running on docker. The documentation wasn't FANTASTIC, but it got me there in the end.
Then I have nginx proxy manager running in another docker container, which handles the virtual hosts for me. It's the one actually bound to 80 and 443. Will help you get set up with SSL certs easily, too.
Thanks for the advice. I'm actually very experienced with vhosts, but my understanding was that vhosts are an Apache thing and Nginx uses different terminology. Unfortunately I am still very green when it comes to Nginx. What you described is exactly what I intend to implement though, and I believe my Mastodon install is already configured properly for that to work. It's just the Lemmy Easy Deploy script that tries to bind all traffic on port 443 where I run into problems.
Hi there! Looks like you linked to a Lemmy community using an URL instead of its name, which doesn't work well for people on different instances. Try fixing it like this: !your_community_name@your.server.name.example
NGiNX is standard installation, using certbot to manage the SSL certificates for the domains.
Setup is via Nginx virtual hosts (servers), separate for Lemmy and Mastodon.
Lemmy and Mastodon run each in their Docker containers, with different listning ports on localhost.
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!
Yes, I am running them both on an Arch server using docker containers. So far no issues at all. Each service runs on its own private internal network so they're isolated. I just have the lemmy-ui listening on port 1236 and mastodon-web listens on port 443.
I tried kbin and don't really understand it to be honest. I looked at their documentation and it doesn't really explain much other than how to create an account on an instance.
Going to kbin.social and creating an account didn't get me much farther. I don't undrestand how to "subscribe" to (for example) the lemmy communities I follow her, or the users I follow on mastodon. And the "magazines" thing I really don't get.
Nope don't feel bad - it's totally understandable. Kbin is new, so the documentation is lacking.
Almost all content on Kbin, including users, has a follow / subscribe button in the sidebar beneath the magazine or user description. There's also a block button. These buttons can be used on almost all Kbin content, so it's very powerful - after spending about a week adding subs, my Kbin feed is far more active than Reddit was, even at its height.
Kbin breaks down your content into Magazines, Microblogs, and Threads. Magazines are synonymous with Communities on Lemmy, or subreddits on reddit. Microblogs are where the Mastodon Toots go, and how you interact with instances based on that architecture. Threads are just like posts on reddit, and can be text only, a link, a pic, or a video (although it seems video is still under development).
The best place to start getting subscriptions are in the magazines section:
...which lists all of the currently federated communities. Putting a domain search into the search bar will bring up all magazines in the instance on that domain:
This domain searching is extremely powerful, especially when you use the domain section (which can be hard to find) - you can get a breakdown of any domain currently federated on kbin by using the following link:
...where you'd put the domain you're interested in in place of 'lemmy.world'. You can then subscribe to the entire instance through that feed, or block it f you'd like. This also works for standard domains as well:
jsyk, with how ActivityPub works changing the software that's running from under it will break federation with you in all sorts of subtle ways. When you pick a thing to run under a domain you're effectively locked into running that software under that domain. And of course there is some cryptographic verification as well so you change the keys (or you wipe or forget to back up the database) you may as well burn that domain from federating ever again.
Definitely look into sandboxed environments and reverse proxy. You'll probably fall into services, then containers and then some sort of orchestration layer. But honestly, check reverse proxies out, they're amazing!
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!
I didn't plan it that way. I installed Mastodon first and didn't use a Docker install. I configured Nginx and reverse proxy and then tried a non-Docker Lemmy install from scratch. That failed, and I believe the reason was some minor version differences in the dependencies. That's when I asked for advice and got a few recommendations to try the Lemmy Easy Deployment script. I would prefer to have done the from scratch install if there was current documentation and dependencies were available, but if there is I wasn't finding it. The Docker compose Lemmy install method worked well enough though so I'm happy with that.