Lugnuts or the Linux User Group Northern University of Texas Students is UT-Arlingtons local LUG for the area and I’ve revived the club since it’s last activity in 2016. I’m currently president and I saw a want for people to experiment with irc and have the option to use a different messaging platform than discord while still being connected in a sense.

The guide below is a ngircd irc server with an irc bot called matterbridge that links the irc server and the discord server we use.

Lugnuts.fun IRC Server Setup Guide

ngIRCd + Let’s Encrypt TLS + Discord Bridge (Matterbridge)

Server Info

  • Domain: irc.lugnuts.fun
  • TLS Port: 6697
  • Channels: #general, #off-topic, #programming
  • Digital Ocean Server instance
    • Plan: Basic Regular | 1 vCPU | 2 GB ram | 50 GB Disk | 2 TB network | $12/mo

1. Prerequisites

  • Debian 12 or 13 server (root access)
  • DNS A/AAAA record for irc.lugnuts.fun (or whatever domain you have) pointing to your server IP
  • Ports 80 (temporary), 6697 (and optionally 6667) open in firewall
  • Email for Let’s Encrypt

2. Install Packages & Get Let’s Encrypt Certificate

apt update && apt upgrade -y
apt install -y ngircd certbot openssl
 
# Get certificate (replace your-email@lugnuts.fun)
certbot certonly --standalone -d irc.lugnuts.fun \
  --non-interactive --agree-tos --email your-email@lugnuts.fun \
  --deploy-hook "mkdir -p /etc/ngircd/ssl && \
                 cp /etc/letsencrypt/live/irc.lugnuts.fun/{fullchain.pem,privkey.pem} /etc/ngircd/ssl/ && \
                 chown -R ngircd:ngircd /etc/ngircd/ssl && \
                 chmod 640 /etc/ngircd/ssl/privkey.pem && \
                 systemctl restart ngircd || true"

Create DH parameters:

openssl dhparam -out /etc/ngircd/dhparams.pem 2048
chown ngircd:ngircd /etc/ngircd/dhparams.pem
chmod 640 /etc/ngircd/dhparams.pem

3. Create ngircd System User

adduser --system --group --no-create-home --disabled-login ngircd

4. NgIRCd Configuration

nano /etc/ngircd/ngircd.conf

Full config:

[Global]
Name = irc.lugnuts.fun
Info = lugnuts.fun IRC Server
Ports = 6667
ServerUID = ngircd
ServerGID = ngircd
AdminInfo1 = lugnuts IRC Admin
AdminInfo2 = Burleson, Texas
AdminEMail = admin@lugnuts.fun
MotdFile = /etc/ngircd/ngircd.motd
Network = lugnuts
PidFile = /var/run/ngircd/ngircd.pid
 
[Limits]
MaxConnections = 100
MaxJoins = 10
MaxNickLength = 31
 
[Options]
AllowedChannelTypes = #&+
PAM = no
 
[SSL]
CertFile = /etc/ngircd/ssl/fullchain.pem
KeyFile = /etc/ngircd/ssl/privkey.pem
DHFile = /etc/ngircd/dhparams.pem
Ports = 6697
CipherList = SECURE128:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1
 
[Operator]
Name = lugnuts
Password = CHANGE_THIS_TO_A_STRONG_PASSWORD
Mask = *
 
# Pre-defined permanent channels
[Channel]
Name = #general
Topic = Welcome to the main hangout! General chat & announcements.
Modes = +ntP
 
[Channel]
Name = #off-topic
Topic = Memes, random stuff, life, everything not serious :)
Modes = +ntP
 
[Channel]
Name = #programming
Topic = Code talk, bugs, projects, languages, help each other out!
Modes = +ntP
 
# keep adding channels here

Create Message of the Day (MOTD):

echo "Welcome to lugnuts.fun IRC!" > /etc/ngircd/ngircd.motd

Current LN MOTD

5. Fix Permissions & Directories

# Config
chown root:root /etc/ngircd/ngircd.conf
chmod 644 /etc/ngircd/ngircd.conf
 
# SSL files
chown ngircd:ngircd /etc/ngircd/ssl/*
chmod 640 /etc/ngircd/ssl/privkey.pem
chmod 644 /etc/ngircd/ssl/fullchain.pem /etc/ngircd/ssl/dhparams.pem
 
# Runtime directories
mkdir -p /var/run/ngircd
chown ngircd:ngircd /var/run/ngircd
chmod 755 /var/run/ngircd
 
# MOTD
chown root:root /etc/ngircd/ngircd.motd
chmod 644 /etc/ngircd/ngircd.motd

6. Run ngIRCd (Two Options)

Option A: As systemd service

systemctl daemon-reload
systemctl enable --now ngircd
systemctl status ngircd

Option B: Manual background (if systemd keeps failing)

# One-time start
nohup /usr/sbin/ngircd -f /etc/ngircd/ngircd.conf >> /var/log/ngircd.log 2>&1 &
 
# Auto-start on boot
crontab -e
# Add this line:
@reboot nohup /usr/sbin/ngircd -f /etc/ngircd/ngircd.conf >> /var/log/ngircd.log 2>&1 &
  • Windows/Linux: HexChat (gui)
  • Terminal: WeeChat
  • Always-online + mobile: The Lounge (self-hosted web client)
  • iOS: iGloo

8. Discord Bridge with Matterbridge

Install Matterbridge

wget https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-64bit -O /usr/local/bin/matterbridge
chmod +x /usr/local/bin/matterbridge

Create Config

mkdir -p /etc/matterbridge
nano /etc/matterbridge/matterbridge.toml

Minimal working config (update the values in bold):

[irc.lugnuts]
Server="irc.lugnuts.fun:6697"
Nick="LugnutsBridge"
UseTLS=true
RemoteNickFormat="[{DISCORD}] <{NICK}> "
 
[discord.lugnuts]
Token="**YOUR_BOT_TOKEN_HERE**"
Server="**YOUR_DISCORD_SERVER_ID**"   # ← Right-click server → Copy Server ID
AutoWebhooks=true                     # Optional but recommended for nice formatting
 
[[gateway]]
name="general-bridge"
enable=true
 
[[gateway.inout]]
account="irc.lugnuts"
channel="#general"
 
[[gateway.inout]]
account="discord.lugnuts"
channel="general"
 
[[gateway]]
name="offtopic-bridge"
enable=true
 
[[gateway.inout]]
account="irc.lugnuts"
channel="#off-topic"
 
[[gateway.inout]]
account="discord.lugnuts"
channel="off-topic"
 
[[gateway]]
name="programming-bridge"
enable=true
 
[[gateway.inout]]
account="irc.lugnuts"
channel="#programming"
 
[[gateway.inout]]
account="discord.lugnuts"
channel="programming"

Run Matterbridge in Background

# Create log file
touch /var/log/matterbridge.log
 
# Start in background
nohup /usr/local/bin/matterbridge -conf /etc/matterbridge/matterbridge.toml >> /var/log/matterbridge.log 2>&1 &
 
# Auto-start on reboot
crontab -e
# Add:
@reboot nohup /usr/local/bin/matterbridge -conf /etc/matterbridge/matterbridge.toml >> /var/log/matterbridge.log 2>&1 &

Discord Bot Setup

  1. https://discord.com/developers/applications → New Application → Bot
  2. Enable Privileged Gateway Intents:
    • Message Content Intent → ON
    • Server Members Intent → ON
  3. Invite bot with Manage Webhooks permission (if using AutoWebhooks)

9. Final Test Commands

# Test ngIRCd config
ngircd --configtest
 
# Check if running
ps aux | grep -E 'ngircd|matterbridge'
 
# Watch logs
tail -f /var/log/ngircd.log
tail -f /var/log/matterbridge.log

Now IRC and Discord are synced together 🎉


Liked what you read? Want to learn more?

Chat with us on IRC at: irc.lugnuts.fun port 6697 with SSL/TLS enabled.

or you can just message us on discord, we support both with matterbridge!