> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postiz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord

> How to add Discord to your system

<Snippet file="never-share.mdx" />

<Note>
  This integration requires that you have **Manage Server** permissions on the Discord server you want to integrate with.
</Note>

<Steps>
  <Step title="Create a Discord Application">
    Login to Discord on the web, and then go to the [Discord Developer Portal](https://discord.com/developers/applications) and click on "New Application".

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/discord/discord_create_app.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=a6ffbe766c52fa977fbb1471f822a622" alt="New Application" width="425" height="265" data-path="images/providers/discord/discord_create_app.png" />
  </Step>

  <Step title="Add an App Icon">
    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/discord/discord_add_app_icon.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=aa5d00c7f1888b7d11cfba9e9d6fc121" alt="App Icon" width="283" height="307" data-path="images/providers/discord/discord_add_app_icon.png" />

    Upload the App Icon of your choice (1024x1024px max) and save your changes. If you do not do this, you will get 404 errors in logs when trying to add the Discord channel in the Postiz web interface.
  </Step>

  <Step title="Get and set your Client ID and Client Secret">
    You can find this in the **OAuth2** section of the Discord Developer Portal.

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/discord/discord_copy_keys.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=2e38f8146bffb0a1197781cdcc5925a2" alt="Copy Keys" width="833" height="336" data-path="images/providers/discord/discord_copy_keys.png" />

    Set these in your .env file as follows;

    ```env theme={null}
    DISCORD_CLIENT_ID="your_client_id"
    DISCORD_CLIENT_SECRET="your_client_secret"
    ```
  </Step>

  <Step title="Add a Redirect URI">
    <Snippet file="oauth2redirect.mdx" />

    **Your Discord OAuth2 Redirect URI:**

    * Production: `https://your-postiz-domain.com/integrations/social/discord`
    * Local development: `http://localhost:4200/integrations/social/discord`
    * Docker: `http://localhost:5000/integrations/social/discord`

    You can find this in the **OAuth2** section of the Discord Developer Portal.

    <img src="https://mintcdn.com/postiz/NC1G4tduhaxm8LzE/images/providers/discord/discord_redirect_uri.png?fit=max&auto=format&n=NC1G4tduhaxm8LzE&q=85&s=20caf16e1d34d0344ad8e339d8b0ee34" alt="Redirect URI" width="474" height="283" data-path="images/providers/discord/discord_redirect_uri.png" />
  </Step>

  <Step title="Create a Bot">
    Navigate to the "Bot" section of the Discord Developer Portal. Fill out the bot details however you like, and then click "Reset Token".

    With the token that is generated, set it in your .env file as follows;

    ```env theme={null}
    DISCORD_BOT_TOKEN_ID="your_bot_token"
    ```

    If you do not set this, you will get 404 errors when trying to add the Discord channel in the Postiz web interface.

    Stop Postiz if it is running, and then start it using the .env file with the Discord details.
  </Step>

  <Step title="Add a Discord channel in the Postiz web interface">
    Go to the Postiz web interface, and click on the "Add Channel" button, and then select "Discord". You should be redirected to Discord to login.
  </Step>
</Steps>
