Federation

Federation

By default the Mastodon accounts are setup to be of the form username@social.example.org when you install Mastodon at social.example.org. This domain is called the LOCAL_DOMAIN in Mastodon terminology.

Changing the LOCAL_DOMAIN will let you have handles as username@example.org even when installed at social.example.org. Changing the LOCAL_DOMAIN is not recommended since it is complicated and in most cases unnecessary. This is because Mastodon account names are not intended to be remembered like usernames (it's not like email where you can start following another account). Instead, users usually visit a website and click the 'Follow' button.

If you decide to not change the LOCAL_DOMAIN, no further configuration is required and your Mastodon instance is already set up for federation.

+

Changing LOCAL_DOMAIN
You can change the account domain name by using the File Manager and changing LOCAL_DOMAIN in /app/data/env.production. After that, you have to configure LOCAL_DOMAIN's web server to serve up .well-known/host-meta query.
-
If LOCAL_DOMAIN is an app on the Dashboard, you can use the Dashboard's Well Known URI support. Go to the Domains view and set the Mastodon domain in the Advanced settings:
-
If the LOCAL_DOMAIN is NOT hosted in the Dashboard, you must figure out a suitable way to serve up the well-known documents. Here are some hints:
- For WordPress, you can setup a redirect using Redirection plugin
- For Ghost,you can add a redirects.json
- For Surfer, simply upload the XML above into .well-known/host-meta.
- For anything else, setup nginx config as follows:
location = /.well-known/host-meta {
       return 301 https://social.example.org$request_uri;
}