While it’s cool to host your own Mastodon server, it’s not really efficient. A simple thing you can do, however, is to make it easier for others to discover your presence, if they already know your website. Try it out – search for “johnmu@johnmu.com” in your Mastodon instance. Also, click “follow” for SEO tips & other bad takes.
Why is hosting your own instance inefficient? In short, sending updates between users (followers, followees) means connections between their individual servers, and if everyone has their own server, it’s a lot of network activity. It costs you money, it costs them money. It’s better if you share instances (and support your server).
Be discoverable with your domain
The solution is Webfinger. On the basis of a set of “well-known” URLs that you host on your website, a social network like Mastodon can look up your account, and present that to the user. We don’t have to make the contents of these URLs ourselves (though you could), we just need to redirect to our official ones.
Practically speaking, you have to redirect two URLs (and tweak their query parameters):
- /.well-known/host-meta
- /.well-known/webfinger
The query parameters (as stolen from another blog post) is the same for each one: ?resource=acct:username@domainname
. To make this work with Mastodon in general, you will need to swap out the username
and domainname
to match the account that you actually use.
For me, that looks like this:
- 301 redirect:
- From:
https://johnmu.com/.well-known/webfinger?resource=acct:john@johnmu.com
- To:
https://mastodon.social/.well-known/webfinger?resource=acct:johnmu@mastodon.social
If you try the link, you should get an XML file from mastodon.social, showing that my account exists. Maybe it still exists when you read this post?
Leave a Reply