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

# Protect My Server

> The ultimate recipe for securing your Discord server from raids, nukes, and rogue administrators using Flare.

<Note>This recipe takes approximately **5 minutes** to complete.</Note>

## Overview

A Discord server can be destroyed in seconds by a compromised admin account or a coordinated raid. Flare is built from the ground up to prevent this.

By following this recipe, you will configure a "fortress" setup using Flare's AntiNuke, AutoMod, and Logging systems.

## Requirements

<Warning>
  **Critical Step:** Flare **MUST** have its role placed at the very top of your server's role hierarchy. Flare cannot punish or stop an attacker if the attacker has a role higher than Flare.
</Warning>

***

## Step 1: Enable AntiNuke

AntiNuke is your primary defense against rogue admins. It detects mass-bans, channel deletions, and role tampering, instantly banning the perpetrator and attempting to recover the deleted assets.

<Tabs>
  <Tab title="Dashboard">
    1. Navigate to the **AntiNuke** module on your dashboard.
    2. Toggle the module to **Enabled**.
    3. Set the default punishment to **Ban**.
    4. Adjust the thresholds (e.g., 3 bans within 10 seconds triggers the nuke protocol).
  </Tab>

  <Tab title="Commands">
    Use the following slash command in your server to quickly enable AntiNuke with default secure settings:

    ```bash theme={null}
    /antinuke enable
    /antinuke punishment set ban
    ```
  </Tab>
</Tabs>

***

## Step 2: Configure AutoMod (Raid Protection)

Raids usually involve bot accounts flooding your server with spam, links, or mass mentions. Flare's AutoMod stops them before they even hit the chat.

<Steps>
  <Step title="Enable Anti-Spam">
    Blocks users sending messages too rapidly.

    ```bash theme={null}
    /automod antispam enable
    ```
  </Step>

  <Step title="Enable Anti-Link & Anti-Invite">
    Prevents malicious phishing links and unauthorized server advertising.

    ```bash theme={null}
    /automod antilink enable
    /automod antiinvite enable
    ```
  </Step>

  <Step title="Set AutoMod Punishment">
    Set a secondary punishment for repeat offenders. If someone triggers AutoMod 3 times, they should be timed out.

    ```bash theme={null}
    /automod punishment set timeout 1h
    ```
  </Step>
</Steps>

***

## Step 3: Whitelist Trusted Bots

If you use other bots for server backups or moderation (like Dyno or Wick), AntiNuke might accidentally trigger on them during legitimate operations.

<CodeGroup>
  ```bash Whitelist via Command theme={null}
  /antinuke whitelist add @BackupBot
  ```
</CodeGroup>

<Info>You generally do not need to whitelist human administrators. Only whitelist service bots that perform bulk actions.</Info>

***

## Best Practices

<CardGroup cols={2}>
  <Card title="Audit Roles Regularly" icon="users-viewfinder">
    Never give "Administrator" to roles that don't need it. Use granular permissions instead.
  </Card>

  <Card title="Enable 2FA" icon="mobile-screen">
    Force all server moderators to enable Two-Factor Authentication in Discord Server Settings.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Flare isn't banning the attacker!">
    This happens when Flare's role is below the attacker's role in the Discord Server Settings. Go to Server Settings > Roles, and drag Flare's integration role to the absolute top.
  </Accordion>

  <Accordion title="My backup bot got banned by AntiNuke">
    When running server backups or cloning channels, Flare sees this as a nuke. You must whitelist your backup bot using `/antinuke whitelist add @Bot` before running the backup.
  </Accordion>
</AccordionGroup>

## Next Steps

Now that your server is protected, you need a way to see what's happening.
👉 **Continue to [Setup Complete Logging](/recipes/setup-complete-logging)**.
