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

# Integrate Discourse with Memberful

> Integrate Memberful with Discourse to run a private discussion forum. Use single sign-on so members access the forum with their Memberful login.

export const RelatedDocs = ({link1, link2, link3, link4, link5, link6, link7, link8, link9, link10, className = ""}) => {
  const links = [link1, link2, link3, link4, link5, link6, link7, link8, link9, link10].filter(Boolean);
  if (!links.length) return null;
  return <section className={`related-docs border dark:border-gray-700 rounded-2xl px-6 py-4 mt-6 ${className}`}>
      <p className="mb-2 font-medium">
        <strong>Related help docs:</strong>
      </p>
      <ul className="space-y-1 mb-1 mt-1">
        {links.map((link, index) => <li key={index}>
            <a href={link.url}>{link.label}</a>
          </li>)}
      </ul>
    </section>;
};

Memberful integrates directly with Discourse so you can manage access to a members-only discussion forum through your memberships. This integration uses groups and single sign-on settings in Discourse to control who can view and participate in your community.

In this help article, we'll show you how to create Discourse groups, connect your forum to Memberful, map plans to groups, protect categories, and manage important Discourse settings.

## Create a Discourse group

Before you connect Discourse to Memberful, create the Discourse groups you want to use for member access.

<Steps>
  <Step title="Open Groups">
    In Discourse, go to **Groups** from the menu icon.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse-groups-menu-item.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=c4accec2cfbebcf6e5cf25447de3b9ea" alt="Groups in the Discourse menu" width="1440" height="689" data-path="images/integrations/community/discourse/discourse-groups-menu-item.png" />
    </Frame>
  </Step>

  <Step title="Create a group">
    Click **New Group**.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse-add-new-group.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=7282d53c0f836dc6e15f10e51aa4f998" alt="Creating a new Discourse group" width="1440" height="278" data-path="images/integrations/community/discourse/discourse-add-new-group.png" />
    </Frame>
  </Step>

  <Step title="Name and save the group">
    Enter a group name, then save it.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse-name-group.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=b41656b52dcc93c28322f8045f6cea42" alt="Naming a Discourse group" width="1440" height="651" data-path="images/integrations/community/discourse/discourse-name-group.png" />
    </Frame>
  </Step>
</Steps>

<Callout icon="info" color="#22E273">
  If you update your Discourse groups after the initial integration, it may take some time for members to re-sync.
</Callout>

## Generate an API key

Generate a Discourse API key before connecting the integration.

<Steps>
  <Step title="Open API settings">
    In Discourse, go to **Admin** → **API**.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-api-key.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=2a6647b6ed546ec227785628888044c6" alt="Discourse API settings" width="1440" height="396" data-path="images/integrations/community/discourse/discourse2-api-key.png" />
    </Frame>
  </Step>

  <Step title="Generate an API key">
    Create an API key for the integration.
  </Step>
</Steps>

## Connect Memberful to Discourse

Use the API key and your Discourse admin details to connect the integration in the Memberful dashboard.

<Steps>
  <Step title="Open Discourse in the Memberful dashboard">
    Go to **Content** → **Community** → **Discourse**.
  </Step>

  <Step title="Start the connection">
    Click **Connect**.
  </Step>

  <Step title="Enter your Discourse details">
    Enter your Discourse site information, including the API key you generated.
  </Step>

  <Step title="Use the Discourse admin account">
    Enter the *Username* and *Email* for the Discourse admin.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-connect.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=daf5ae8590f729e8e577020f36dbdf9d" alt="Connecting Memberful to Discourse" width="1440" height="1311" data-path="images/integrations/community/discourse/discourse2-connect.png" />
    </Frame>
  </Step>
</Steps>

## Review Discourse settings changed by Memberful

When Memberful connects to Discourse, it updates several Discourse settings automatically.

<Callout icon="triangle-alert" color="#FFE044">
  Do not reset the *DiscourseConnect (SSO)* settings. If you reset them, the integration stops working.
</Callout>

## Advanced: Discourse settings

When Memberful connects to Discourse, it updates some of your default Discourse settings. Don't reset the DiscourseConnect settings or the integration will stop working.

### **Settings → Login**

* `enable discourse connect`: On (formerly `enable_sso`)
* `enable discourse connect provider`: Off (formerly `enable sso provider`)
* `discourse connect url`: Set by Memberful (formerly `sso url`)
* `discourse connect secret`: Set by Memberful (formerly `sso secret`)
* `auth overrides email`: On (formerly `sso overrides email`)
* `auth overrides name`: On (formerly `sso overrides name`)

### **Settings → Users**

* `email editable`: Off

### **Settings → Posting**

* `display name on posts`: On

### **Settings → Plugins**

* `disable discourse narrative bot welcome post`: On

<Steps>
  <Step title="Open Discourse settings">
    Go to **Content** → **Community** → **Discourse**.
  </Step>

  <Step title="Edit the settings">
    Click **Edit settings**.
  </Step>

  <Step title="Map plans to groups">
    Choose which membership plans should be linked to which Discourse groups.
  </Step>

  <Step title="Save your changes">
    Click **Update settings**.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse-groups.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=4701ce64905f8d50b66ec693cc1867ad" alt="Mapping Memberful plans to Discourse groups" width="1440" height="937" data-path="images/integrations/community/discourse/discourse-groups.png" />
    </Frame>
  </Step>
</Steps>

These settings do not apply to members who [register for free](/member-management/payments-and-access/give-free-access/#enable-free-registration).

Once setup is complete, active members are added automatically to their assigned Discourse group after they sign in through Memberful.

<Callout icon="triangle-alert" color="#FFE044">
  If a member's subscription expires, they are removed from the associated Discourse group, even if they still have a Discourse account.
</Callout>

## Protect your Discourse categories

To restrict access to member-only areas, update the security settings on the Discourse categories you want to protect.

<Steps>
  <Step title="Open the category editor">
    Click the Discourse category, then click the **Wrench** icon.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-edit-categories.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=90641dbffab400bf0726f22aed545660" alt="Editing a Discourse category" width="1440" height="266" data-path="images/integrations/community/discourse/discourse2-edit-categories.png" />
    </Frame>
  </Step>

  <Step title="Open Security">
    Go to the **Security** settings for the category.
  </Step>

  <Step title="Add the group">
    Click **Add a group** and select the Discourse group.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-members-group.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=9b38e78fb81b7a40ab6d06e6ade4f85d" alt="Adding a members group to a Discourse category" width="1440" height="708" data-path="images/integrations/community/discourse/discourse2-members-group.png" />
    </Frame>
  </Step>

  <Step title="Set category permissions">
    Choose the **See / Reply / Create** permissions for that group.
  </Step>

  <Step title="Save the category">
    Click **Save Category**.

    <Frame>
      <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-save-category.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=7de3ec7d38a9b95d28e0fabbaddffe28" alt="Saving category security settings in Discourse" width="1440" height="708" data-path="images/integrations/community/discourse/discourse2-save-category.png" />
    </Frame>
  </Step>
</Steps>

Repeat this process for each members-only category.

### Default categories

Default Discourse categories such as **Meta** do not have security settings. If you want a members-only forum, do not use the default categories for protected content.

### Disable posting to Uncategorized

The **Uncategorized** category does not include a **Security** tab. To prevent posting there, go to **Admin** → **Settings** → **Posting** and disable posting to **Uncategorized**.

<Frame>
  <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-uncategorized.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=453ac74f5da22e7b3a1a42c39a601014" alt="Disabling posting to Uncategorized in Discourse" width="1440" height="206" data-path="images/integrations/community/discourse/discourse2-uncategorized.png" />
</Frame>

## Disallow anonymous access

If you run a protected Discourse forum, it is a good idea to disable anonymous access.

Go to **Settings** → **Login** and disallow anonymous access.

<Frame>
  <img src="https://mintcdn.com/memberful/OMtzINyMMcE4X0hP/images/integrations/community/discourse/discourse2-anonymous.png?fit=max&auto=format&n=OMtzINyMMcE4X0hP&q=85&s=9afda5e3e4b3bbcfa922e4b6f8fb4294" alt="Disallowing anonymous access in Discourse" width="1440" height="176" data-path="images/integrations/community/discourse/discourse2-anonymous.png" />
</Frame>

When anonymous access is disabled, members must sign in through Memberful to view the forum.

## Set up Discourse admins

Memberful does not allow non-admin Memberful users to remain Discourse admins. This protects your Discourse admin access because Memberful does not verify email ownership for that role.

To set up Discourse admins correctly, create them as Memberful staff. Go to **Settings** → **Staff** in the Memberful dashboard.

### Access the forum as an admin

Memberful uses the member login page for single sign-on because most Discourse users are members. If you want to access your Discourse forum as an admin, sign in to the Memberful dashboard first.

### Make a paying member a moderator

If you make a paying member a Discourse admin, Memberful removes the admin flag the next time that member syncs. Memberful does not remove the moderator flag, so paying members can still be Discourse moderators.

## Add a signup link to your forum

When single sign-on is enabled, Discourse shows a login button but not a signup button.

To add a signup link to your forum, create a Memberful plan, copy the plan purchase link, and add that link to your website or forum. You can also [customize your Discourse header](https://meta.discourse.org/t/best-way-to-customize-the-header/13368/6) to include the link.

## Disable Discourse integration

When you disable the Discourse integration, Memberful attempts to disable Memberful single sign-on on your forum. After the integration is disabled successfully, you and your members can sign in to the forum normally again.

If you cannot sign in to your forum after disabling the integration, use this URL to access the admin login and fix your Discourse settings:

```text theme={null}
https://forum.yoursite.com/u/admin-login
```

<RelatedDocs
  link1={{
url: "/member-interface/subscription/access-member-benefits/#log-in-to-your-discourse-community",
label: "Learn how your members can access your Discourse community",
}}
/>
