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?

  • GreenDot 💚@le.fduck.net
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    I’m running both, via docker.

    Here’s the basic setup:

    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.

                      lemmy.domain.tld+------------------------+
                   +------------------+                        |
                   |                  |         Lemmy          |
                   |                  |         127.0.0.1:3000 |
                   |                  +------------------------+
                   |
    +--------------+----+
    |NGiNX with SSL     |   mastodon.domain.tld
    |and separate VHOSTS+--------------+-----------------------+
    |                   |              |          Mastodon     |
    +-------------------+              |          127.0.0.1:3001
                                       +------------------------
    
    
  • Meow.tar.gz@lemmy.goblackcat.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    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.

  • Daedric@lemmy.aguiarvieira.pt
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    No, because finding Lemmy dockers compatible with arm64 is hard.

    Easy Lemmy bundles Caddy and it makes it difficult to adapt.

  • veroxii@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    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.

  • immibis@social.immibis.com
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    @TrinityTek@lemmy.world @selfhosted@lemmy.world Everything on your server has a URL, like https://your.server.name.example/c/your_community_name. Unless you want all the official public URLs to everything on your server to have a port number in them (https://your.server.name.example:1234/TrinityTek) you probably want to figure this out <i>before</i> deploying anything.

    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

  • Voroxpete@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    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.

    • TrinityTek@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 year ago

      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!

      • Voroxpete@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        I would personally recommend putting them both in Docker containers, but I’m glad it’s working for you.

        • TrinityTek@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          Thanks for the suggestion. What would be the benefit of switching to a docker install of Mastodon?

          • Voroxpete@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            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.

            • TrinityTek@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 year ago

              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.