⚠️

NOTE: Postiz is currently hard-coded to use mastodon.social only. This will become more flexible to support other servers in a future release.

Mastodon client registration is not done via ther web interface, but by talking to the API directly. In the example below, we use curl to register a new client.

Optionally check that you have jq installed on your system. You can normally install this with brew, apt-get, yum or chocolatey. If you don’t have jq installed, you can remove it from the command below.


The OAuth2 Redirect URI is the location where the provider will redirect to after trying to login. This needs to set to your Postiz FRONTEND_URL + /integrations/social/ + mastodon.

  • eg: If you are running on a container, and your Postiz URL is: https://postiz.example.com, then your OAuth2 Redirect URI is https://postiz.example.com/integrations/social/mastodon
  • eg: If you are running on localhost, and your Postiz URL is http://localhost:4200, then your OAuth2 Redirect URI is http://localhost:4200/integrations/social/mastodon

You only need to set one OAuth2 Redirect URI when you are setting up your Postiz app.

Run the following curl command in a terminal to get the Mastodon client id and client secret.

curl -X POST -sS https://mastodon.social/api/v1/apps -F "client_name=YourAppName" -F "redirect_uris=http://localhost:4200/integrations/social/mastodon" -F "scopes=write:statuses write:media profile" | jq

This will give you output that looks something like this;

{
  "id": "1234567890",
  "redirect_uris": [
    "http://localhost:4200/integrations/social/mastodon"
  ],
  ...
  "client_id": "your_client_id",
  "client_secret": "your_client_secret"
}

Make a note of your client_id and client_secret and add them to your .env file.

MASTODON_CLIENT_ID="shown in the output from the above command"
MASTODON_CLIENT_SECRET="shown in the output from the above command"

Stop Postiz if it is running, and then start it using the .env file with the Mastodon details. Click through the new channel setup and you should be asked to login on Mastodon.