Skip to main content
On your own instance you register the Mastodon client yourself and put its keys in your environment. Mastodon client registration does not happen in a web interface. You talk to the API directly, and curl is the shortest way 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 do not have jq installed, you can remove it from the command below.
The examples on this page use https://mastodon.social as the default Mastodon instance. If you are setting up PostQueen to connect to a different self-hosted Mastodon instance (e.g., https://fosstodon.org), you must replace https://mastodon.social with your instance’s URL in the curl command below. You will also need to ensure the MASTODON_URL environment variable in your application’s .env file (or equivalent configuration for Docker, etc.) is set to your custom instance’s URL.
1

Register your client

Your Mastodon OAuth2 Redirect URI:
  • Production: https://postqueen.example.com/integrations/social/mastodon
  • Local development: http://localhost:4200/integrations/social/mastodon
  • Docker: http://localhost:4007/integrations/social/mastodon
Run the following curl command in a terminal to get the Mastodon client id and client secret.
This will give you output that looks something like this;
2

Add credentials to your environment

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

Start PostQueen

Stop PostQueen 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.
The channel is in the left sidebar with its avatar and name. That is the whole confirmation: if it is in the list, she can post to it.

Troubleshooting

”Failed to fetch” / “fetch failed” when connecting

The PostQueen backend needs network access to reach your Mastodon instance. If the connect call fails at this stage, the backend container could not resolve or reach the MASTODON_URL host. Fix
  1. From inside the backend container, run curl -I https://mastodon.example.com/. If that fails, fix DNS/egress before retrying.
  2. If you are behind a corporate proxy, set HTTPS_PROXY on the backend.
  3. Confirm MASTODON_URL exactly matches your instance (protocol included, no trailing slash issues).

Next steps

What she can post to Mastodon

Limits, post types and settings

Configuration reference

Every variable she reads

Connect errors

Invalid state, invalid_grant and the rest

Another channel

Every network, and what each one asks for