# Discord

### Create a Discord Application[](https://docs.postiz.com/providers/discord#create-a-discord-application)

Login to Discord on the web, and then go to the [Discord Developer Portal<span class="nx-sr-only nx-select-none">(opens in a new tab)</span>](https://discord.com/developers/applications) and click on "New Application".

[![discord_create_app.webp](https://help.digime.ca/uploads/images/gallery/2024-10/scaled-1680-/uBl6xzTV8QSYzaUN-discord-create-app.webp)](https://help.digime.ca/uploads/images/gallery/2024-10/uBl6xzTV8QSYzaUN-discord-create-app.webp)

### Get and set your **Client ID** and **Client Secret** to a safe place.[](https://docs.postiz.com/providers/discord#get-and-set-your-client-id-and-client-secret-to-a-safe-place)

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

[![discord_copy_keys.webp](https://help.digime.ca/uploads/images/gallery/2024-10/scaled-1680-/hXErRsvWLRGNAcgf-discord-copy-keys.webp)](https://help.digime.ca/uploads/images/gallery/2024-10/hXErRsvWLRGNAcgf-discord-copy-keys.webp)

Set these in your .env file as follows;

```
DISCORD_CLIENT_ID="your_client_id"DISCORD_CLIENT_SECRET="your_client_secret"
```

<div class="nextra-code-block nx-relative nx-mt-6 first:nx-mt-0" id="bkmrk--4"><div class="nx-opacity-0 nx-transition [div:hover>&]:nx-opacity-100 focus-within:nx-opacity-100 nx-flex nx-gap-1 nx-absolute nx-m-[11px] nx-right-0 nx-top-0" style="box-sizing: border-box; border: 0px solid rgb(229, 231, 235); --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-shadow: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-shadow-colored: 0 0 transparent; position: absolute; right: 0px; top: 0px; margin: 11px; display: flex; gap: 0.25rem; opacity: 0; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter, backdrop-filter; transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);"><button class="nextra-button nx-transition-all active:nx-opacity-50 nx-bg-primary-700/5 nx-border nx-border-black/5 nx-text-gray-600 hover:nx-text-gray-900 nx-rounded-md nx-p-1.5 dark:nx-bg-primary-300/10 dark:nx-border-white/10 dark:nx-text-gray-400 dark:hover:nx-text-gray-50" tabindex="0" title="Copy code"><svg class="nextra-copy-icon nx-pointer-events-none nx-h-4 nx-w-4" fill="none" height="24" stroke="currentColor" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><rect height="13" rx="2" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="13" x="9" y="9"></rect><path d="M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg></button></div></div>### Create a Bot[](https://docs.postiz.com/providers/discord#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;

```
DISCORD_BOT_TOKEN_ID="your_bot_token"
```

<div class="nextra-code-block nx-relative nx-mt-6 first:nx-mt-0" id="bkmrk--6"><div class="nx-opacity-0 nx-transition [div:hover>&]:nx-opacity-100 focus-within:nx-opacity-100 nx-flex nx-gap-1 nx-absolute nx-m-[11px] nx-right-0 nx-top-0" style="box-sizing: border-box; border: 0px solid rgb(229, 231, 235); --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgba(59,130,246,.5); --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-shadow: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-shadow-colored: 0 0 transparent; position: absolute; right: 0px; top: 0px; margin: 11px; display: flex; gap: 0.25rem; opacity: 0; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter, backdrop-filter; transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);"><button class="nextra-button nx-transition-all active:nx-opacity-50 nx-bg-primary-700/5 nx-border nx-border-black/5 nx-text-gray-600 hover:nx-text-gray-900 nx-rounded-md nx-p-1.5 dark:nx-bg-primary-300/10 dark:nx-border-white/10 dark:nx-text-gray-400 dark:hover:nx-text-gray-50" tabindex="0" title="Copy code"><svg class="nextra-copy-icon nx-pointer-events-none nx-h-4 nx-w-4" fill="none" height="24" stroke="currentColor" viewbox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><rect height="13" rx="2" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="13" x="9" y="9"></rect><path d="M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg></button></div></div>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.

### Add a Redirect URI[](https://docs.postiz.com/providers/discord#add-a-redirect-uri)

The redirect URI is the URL that Discord will redirect to after you have logged in. Assuming you are runnning Postiz on `postiz.example.com`, this would be: `https://postiz.example.com/integrations/social/discord`. Alternatively if you are running on `localhost:4200`, this would be `http://localhost:4200/integrations/social/discord`.

### Add a Discord channel in the Postiz web interface[](https://docs.postiz.com/providers/discord#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.