I’m interested in setting up my own instances for Lemmy, Mastodon, and Matrix.

Can I use the same https://domain.tld for all of them without any subdomains?

For example:
lemmyuser@mydomain.tld
mastodonuser@mydomain.tld
matrixuser@mydomain.tld

Will this work across all of my self-hosted instances, or do I need to append a subdomain for each, e.g., lemmyuser@lemmy.mydomain.tld?

  • Ultimately, you need some way of routing the traffic to the correct place. Having all 3 services on the same domain, listening on the same ports is going to be a nightmare to manage because something needs to be clever enough to route the traffic to the right service without any information to go off of, other than maybe headers. Expensive firewalls can technically do this but it’s not fun to configure and is really brittle.

    As inferred, you could use the same domain but you’d have to configure your services to listen on a different port so you’ll end up with something like https://domain.tld:8443 for Mastodon and https://domain.tld:8444 for lemmy.

    You can technically use subfolders, i.e. domain.tld/mastodon and domain.tld/lemmy but you’re not going to get the results you want and I can’t say for sure that the software will deal with it nicely.

    This is why we tend to use reverse proxies and configure them to route all traffic from subdomaina.domain.tld to one service and subdomainb.domain.tld to another service. It’s just easier.