Channels

How to Connect OpenClaw to IRC

4 min read

Browse more in Channels.

All channels guides →

This guide shows you how to connect OpenClaw to IRC so your agents can live in classic `#channels` and direct messages. irc` config, control who can talk to the bot, and tune mention behavior so it replies when and where you expect.

By the end, your OpenClaw gateway will join your IRC server and respond safely in the channels you allow.

Setup flow

Prerequisites

  • An OpenClaw gateway already installed and runnable with the `openclaw gateway run` command.
  • Access to an IRC server (private IRC server recommended; public networks like Libera.Chat, OFTC, or Snoonet are supported if you accept the security tradeoffs).
  • Permission to create or join at least one IRC channel such as `#openclaw` for the bot.
  • A NickServ account on your IRC network if you plan to use NickServ identification or registration.

Steps

  1. 1

    Enable the IRC channel in your OpenClaw config

    Start by turning on the IRC extension in your main OpenClaw config so the gateway knows to connect. json` and add an `irc` block under `channels` with `enabled: true`.

    This is also where you point OpenClaw at your IRC host, port, and initial channels.

    json
    {
      channels: {
        irc: {
          enabled: true,
          host: "irc.example.com",
          port: 6697,
          tls: true,
          nick: "openclaw-bot",
          channels: ["#openclaw"],
        },
      },
    }
  2. 2

    Prefer a private IRC server or choose a public network carefully

    Decide where your bot will live: a private IRC server is safer for bot coordination, while public networks expose it to anyone who can see the channel. If you intentionally use a public IRC network, stick to well-known networks and avoid predictable channel names for internal bot traffic.

    This choice affects how strict you should be with access control and tools.

    text
    Prefer a private IRC server for bot coordination. If you intentionally use a public IRC network, common choices include Libera.Chat, OFTC, and Snoonet. Avoid predictable public channels for bot or swarm backchannel traffic.
  3. 3

    Control who can DM or talk to the bot in channels

    Configure access control so random IRC users cannot drive your agent. groups` to decide which channels the bot listens to, and `allowFrom` / `groupAllowFrom` to decide which senders can trigger it.

    This step prevents the common gotcha where the bot connects but silently drops channel messages due to allowlists.

    json
    {
      channels: {
        irc: {
          groupPolicy: "allowlist",
          groups: {
            "#tuirc-dev": { allowFrom: ["*"] },
          },
        },
      },
    }
  4. 4

    Decide whether the bot requires mentions in channels

    By default, OpenClaw uses mention-gating in group contexts, so it drops channel messages that do not mention the bot. If you want the bot to respond to every message in a channel, disable mention gating for that channel and keep an eye on who can send messages.

    You can also open all channels and still disable mention gating with a wildcard group.

    json
    {
      channels: {
        irc: {
          groupPolicy: "allowlist",
          groups: {
            "#tuirc-dev": {
              requireMention: false,
              allowFrom: ["*"],
            },
          },
        },
      },
    }
    
    {
      channels: {
        irc: {
          groupPolicy: "open",
          groups: {
            "*": { requireMention: false, allowFrom: ["*"] },
          },
        },
      },
    }
  5. 5

    Restrict tools for public channels and per-sender access

    If you allow `allowFrom: ["*"]` in a public channel, lock down which tools the bot can use there so strangers cannot trigger sensitive operations. You can define a single tools policy for everyone in a channel, or use `toolsBySender` so your own nick keeps more capabilities while the wildcard `*` stays restricted.

    This is critical when your bot runs tools that touch runtime, filesystem, or external systems.

    json
    {
      channels: {
        irc: {
          groups: {
            "#tuirc-dev": {
              allowFrom: ["*"],
              tools: {
                deny: ["group:runtime", "group:fs", "gateway", "nodes", "cron", "browser"],
              },
            },
          },
        },
      },
    }
    
    {
      channels: {
        irc: {
          groups: {
            "#tuirc-dev": {
              allowFrom: ["*"],
              toolsBySender: {
                "*": {
                  deny: ["group:runtime", "group:fs", "gateway", "nodes", "cron", "browser"],
                },
                "id:eigen": {
                  deny: ["gateway", "nodes", "cron"],
                },
              },
            },
          },
        },
      },
    }
  6. 6

    Configure NickServ identification or registration if needed

    If your IRC network uses NickServ, configure OpenClaw to identify after connecting so it can hold your chosen nick. You can also enable one-time registration on connect for a fresh bot nick, then disable registration once it is done to avoid repeated REGISTER attempts.

    This keeps your bot compliant with networks that enforce registered nicks.

    json
    {
      channels: {
        irc: {
          nickserv: {
            enabled: true,
            service: "NickServ",
            password: "your-nickserv-password",
          },
        },
      },
    }
    
    {
      channels: {
        irc: {
          nickserv: {
            register: true,
            registerEmail: "bot@example.com",
          },
        },
      },
    }
  7. 7

    Start or restart the OpenClaw gateway to connect to IRC

    irc` settings and connects to your IRC server. Watch the logs for connection, NickServ, and message handling events to confirm access control and mention behavior work as expected.

    Any changes to the config require another restart to take effect.

    bash
    openclaw gateway run

Configuration

OptionDescriptionExample
channels.irc.enabledTurns the IRC extension plugin on so OpenClaw connects to IRC.
channels.irc.hostHostname of the IRC server OpenClaw connects to.irc.example.com
channels.irc.portPort of the IRC server, typically 6697 for TLS.
channels.irc.tlsEnables TLS for the IRC connection; recommended unless you accept plaintext.
channels.irc.nickNickname OpenClaw uses when connecting to IRC.openclaw-bot
channels.irc.channelsList of IRC channels OpenClaw joins on connect.
channels.irc.dmPolicyPolicy for handling IRC direct messages; defaults to "pairing".pairing
channels.irc.groupPolicyPolicy for handling IRC channels; defaults to "allowlist" and can be set to "open".allowlist
channels.irc.groupsPer-channel configuration for which channels are allowed and how they behave.
channels.irc.allowFromDM sender allowlist that controls who can talk to the bot in IRC direct messages.
channels.irc.groupAllowFromGlobal channel sender allowlist that controls who can trigger the bot in any IRC channel.
channels.irc.groups["#channel"].allowFromPer-channel sender allowlist; set to ["*"] to allow anyone in that channel.
channels.irc.groups["#channel"].requireMentionControls whether the bot requires a mention to reply in that channel.
channels.irc.groups["#channel"].tools.denyList of tool groups or tools the bot is not allowed to use in that channel.
channels.irc.groups["#channel"].toolsBySenderPer-sender tool policy for a channel, keyed by IRC sender identity like id:eigen.
channels.irc.dangerouslyAllowNameMatchingEnables bare nick matching in allowlists instead of stable nick!user@host identities.
channels.irc.nickserv.enabledEnables NickServ identification after connecting to IRC.
channels.irc.nickserv.serviceNickServ service name used for identification.NickServ
channels.irc.nickserv.passwordNickServ password used to identify the bot's nick.your-nickserv-password
channels.irc.nickserv.registerEnables one-time NickServ registration on connect for the bot nick.
channels.irc.nickserv.registerEmailEmail address used when registering the bot nick with NickServ.bot@example.com
IRC_HOSTEnvironment variable for the IRC server host for the default account.irc.example.com
IRC_PORTEnvironment variable for the IRC server port for the default account.6697
IRC_TLSEnvironment variable that toggles TLS for the IRC connection.true
IRC_NICKEnvironment variable for the IRC nickname of the bot.openclaw-bot
IRC_USERNAMEEnvironment variable for the IRC username field.openclaw
IRC_REALNAMEEnvironment variable for the IRC realname/gecos field.OpenClaw Bot
IRC_PASSWORDEnvironment variable for the IRC server password if your network requires one.server-password
IRC_CHANNELSEnvironment variable listing IRC channels to join, comma-separated.#openclaw,#tuirc-dev
IRC_NICKSERV_PASSWORDEnvironment variable for the NickServ password for the default account.your-nickserv-password
IRC_NICKSERV_REGISTER_EMAILEnvironment variable for the NickServ registration email for the default account.bot@example.com

Troubleshooting

Bot connects to IRC but never replies in channels

This usually means group access or mention-gating is blocking messages. groups` is configured for the channel and check logs for `missing-mention`; if you want replies without pings, set `requireMention:false` for that channel.

bash
{
  channels: {
    irc: {
      groupPolicy: "allowlist",
      groups: {
        "#tuirc-dev": {
          requireMention: false,
          allowFrom: ["*"],
        },
      },
    },
  },
}

Logs show: irc: drop group sender alice!ident@host (policy=allowlist)

The sender is not allowed for group/channel messages, so the bot drops them even if the channel is allowed. allowFrom`.

bash
{
  channels: {
    irc: {
      groupPolicy: "allowlist",
      groups: {
        "#tuirc-dev": { allowFrom: ["*"] },
      },
    },
  },
}

Login or registration with NickServ fails

If NickServ login fails, the nick might already be taken or the password is wrong; verify nick availability and the NickServ password. For registration issues, confirm `register` and `registerEmail` are set correctly, then disable `register` after the nick is registered to avoid repeated REGISTER attempts.

bash
{
  channels: {
    irc: {
      nickserv: {
        enabled: true,
        service: "NickServ",
        password: "your-nickserv-password",
      },
    },
  },
}

{
  channels: {
    irc: {
      nickserv: {
        register: true,
        registerEmail: "bot@example.com",
      },
    },
  },
}

TLS connection to a custom IRC network fails

When TLS fails, the usual cause is a mismatch between host, port, or certificate configuration on the IRC server. Double-check that `host`, `port`, and `tls:true` match your server's TLS listener and that the certificate is valid for the hostname you configured.

bash
{
  channels: {
    irc: {
      enabled: true,
      host: "irc.example.com",
      port: 6697,
      tls: true,
      nick: "openclaw-bot",
      channels: ["#openclaw"],
    },
  },
}

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Channels