Mastodon and ActivityPub Relays

Self-Hosting May 13, 2023

ActivityPub Relays: Connecting the Federated Network

Mastodon, Pixelfed and Pleroma are examples of decentralized social media based on the ActivityPub protocol. This means that the network is made up of independent servers, called instances, which can communicate with each other to share information and content. However, one potential issue with this model is that it can lead to instances becoming isolated from one another if they don't have many connections.

Introducing ActivityPub Relays

To address this problem, ActivityPub introduced a feature called relays. A relay is essentially an intermediary server that helps to connect instances that might not otherwise have any direct connections. Relays can be set up by anyone and can be configured to relay specific types of content, such as only posts that are marked as public or only posts that contain specific hashtags.

How ActivityPub Relays Work

Relays work by subscribing to the feeds of instances and then relaying that content to other relays and instances. This means that when a user posts content on their instance, it can potentially be seen by users on other instances that are connected through relays. This helps to increase the reach of content and can help to foster a more interconnected and vibrant network.

Considerations When Using ActivityPub Relays

One downside of using relays is that it can increase the load on your server and use up more bandwidth and resources. Additionally, relays can potentially relay inappropriate content if they are not properly moderated. However, these issues can be mitigated by carefully configuring your relay and monitoring its activity.


In conclusion, ActivityPub relays are an important tool for connecting instances and expanding the reach of content on the platform. By setting up a relay, you can help to create a more vibrant and interconnected network and contribute to the growth and success of the ActivityPub community.

Adding ActivityPub Relays

As a Mastodon Admin you can add relays under Administraion > Relays within settings.

You can find ActivityPub Relays on the following sites:

Be cautious not to add too many relays as these will quickly eat up your server resources and make your instance slow. I'd start by adding 1-3 relays and see how your server handles it.