install

SekurIRCd builds from source with a C11 compiler and make. Every change is built and run through the unit tests and the full integration suite on Linux (x86-64 and arm64), macOS, FreeBSD, OpenBSD, NetBSD and Windows (Cygwin), and a release needs all of them to pass. Prefer a container? There is an image for x86-64 and arm64.

dependencies

build

git clone https://github.com/gcanosa/SekurIRCd.git
cd SekurIRCd
make            # release build -> bin/sekurircd, bin/services
make debug      # ASan+UBSan build -> bin/sekurircd-debug
make check      # build and run tests/unit.c
make clean

make compiles in parallel, one job per core. make -j4 picks another number, and make JOBS=1 builds one file at a time (make -j1 does the same on GNU make 4, but the 3.81 that macOS ships cannot see a -j and would still use every core: use JOBS= there). Several goals in one command, such as make clean all, stay serial.

create the config

The quickest way is to let SekurIRCd ask. tools/makeconf.py asks about the server, TLS, cloaking, operators and services. It then writes a complete config/sekurircd.toml, a config/protection.toml if you turn on the Protection bundle, and, if you want NickServ and ChanServ, a services/services.toml whose link settings match it. bin/sekurircd --makeconf runs the same tool. It first asks what the machine runs: the usual setup (services next to the server), a server whose services run on another machine (it writes the TLS link for them and a ready services-remote.toml to copy there, with the certificate fingerprint filled in), or only the services daemon (just services.toml, no ircd). Services on their own machine has the details.

tools/makeconf.py                  # writes config/sekurircd.toml and services/services.toml
./bin/sekurircd --makeconf         # the same, started from the ircd binary
tools/makeconf.py -c /etc/sekurircd/sekurircd.toml -s /etc/sekurircd/services.toml   # other paths
tools/makeconf.py --print          # write nothing, print the files

It needs Python 3.8 or newer and no extra packages. It ships in the source tree, not with make install; an installed sekurircd --makeconf prints where to get it. To use a browser instead, the web wizard builds the same two files.

run

To write the config by hand instead, start from the documented template:

cp config/sekurircd.template.toml config/sekurircd.toml
# edit config/sekurircd.toml (port, operators, TLS, ...)
cp config/protection.template.toml config/protection.toml   # optional: the Protection bundle
./bin/sekurircd --config config/sekurircd.toml    # listens on 0.0.0.0:6667 by default

./bin/sekurircd --hash-password    # prompts, no echo, prints an scrypt hash for [[operators]]
./bin/sekurircd --version

Smoke test from another terminal:

nc 127.0.0.1 6667
NICK test
USER test 0 * :Test User
JOIN #general
PRIVMSG #general :hello
QUIT

Optional: for a trusted TLS certificate instead of a self-signed one, run tools/mkcert.sh --domain irc.example.org (see configuration: tls).

start/stop/status script

The repo root ships a small wrapper, ./sekurircd, that runs both daemons in the background with the right flags and pidfiles, so you don't manage them by hand:

./sekurircd start     # sekurircd, plus services (NickServ + ChanServ) if services/services.toml exists
./sekurircd status    # running/stopped for each, with pid
./sekurircd restart   # stop both, wait, start both
./sekurircd stop      # stops services first, then sekurircd (graceful)

It always works from the repo directory, using config/sekurircd.toml, services/services.toml and the pidfiles sekurircd.pid and services/services.pid. It refuses to start if bin/ isn't built yet, services are skipped when they aren't configured (then there is no NickServ, ChanServ or SASL), and starting an already-running daemon is refused rather than duplicated. A still-running standalone ChanServ from an older release (services/chanserv.pid) is stopped first, so there are never two. If status finds a matching process but no valid pidfile, it says so instead of reporting "stopped". ./bin/sekurircd --rehash reloads the config without restarting.

upgrade

For a git-clone install, tools/upgrade.py picks the latest release or the latest main, shows what changes (versions, changelog, new config options), backs everything up, builds, installs and optionally restarts, and can roll back.

tools/upgrade.py              # interactive
tools/upgrade.py --check      # only report new releases/commits (exit 10 = updates available, 11 = not a git checkout)
tools/upgrade.py --dry-run    # show everything, change nothing
tools/upgrade.py --rollback   # undo the last upgrade

Installed from a source tarball (.tar.gz or zip) instead of git clone? There is no .git to upgrade from, so the interactive run offers to make one: it fetches upstream into a new .git and points it at the commit your files match best (the release src/version.h names, or main), shows any files that differ, and carries on with the upgrade. Only .git is written; none of your files, config or binaries is touched, and rm -rf .git undoes it. --yes alone never converts (use --convert for that, and --origin URL to fetch from a mirror or fork). If the files match no release closely, it advises a fresh git clone instead and defaults to no.

Your live config is only changed with your OK: before restarting it offers tools/confcheck.py --fix, which moves settings to where they live now. Locally edited files are kept. If upstream rewrote its history with the same code, it moves the checkout onto it. It also warns when what's running is older than the checkout (a stale build, or a daemon started before the last build) and offers to rebuild and restart. Each run writes logs/SekurIRCd-upgrade-<date>.log.

backup and restore

tools/backup-config.sh packs everything you'd carry to a new machine or version into one private archive: the live configs, accounts and their rotating backups, K-lines, MOTDs, TLS keys and ChanServ registrations.

tools/backup-config.sh [DIR]                    # back up (asks for DIR, default /tmp)
tools/backup-config.sh --restore [ARCHIVE|DIR]  # restore one (lists the backups in DIR to pick from)

A restore shows which files are new, changed or the same, backs up the current files next to the archive first, then runs tools/confcheck.py (and the daemons' own --check) on the result and rolls back if it fails. Archives with paths outside config/ and services/ are refused. To restore a single file, tar -xzf ARCHIVE config/sekurircd.toml run from the repo directory is enough.

daemon mode

./bin/sekurircd --config config/sekurircd.toml --daemon --pidfile /var/run/sekurircd.pid
./bin/sekurircd --stop   --pidfile /var/run/sekurircd.pid   # graceful stop, removes the pidfile
./bin/sekurircd --rehash --pidfile /var/run/sekurircd.pid   # reload config live (SIGHUP)

Without --pidfile the default is ./sekurircd.pid (or $SEKURIRCD_PIDFILE). Once daemonized, stdout and stderr go to /dev/null, so enable [logging] in the config.

systemd user service

make install sets both daemons up as systemd user units (Linux only). Nothing needs root: everything installs under $HOME, and the default ports (6667/6697) are above 1024.

make
make install
#  binaries         -> ~/.local/bin
#  config templates -> ~/.config/sekurircd   (never overwrites a live sekurircd.toml)
#  state and logs   -> ~/.local/state/sekurircd/{ircd,services,stats}
#  stats panel      -> ~/.local/lib/sekurircd/stats/netstats.py
#  units            -> ~/.config/systemd/user

cp ~/.config/sekurircd/sekurircd.template.toml ~/.config/sekurircd/sekurircd.toml
cp ~/.config/sekurircd/protection.template.toml ~/.config/sekurircd/protection.toml   # optional: the Protection bundle
systemctl --user enable --now sekurircd services   # services start, stop and restart with sekurircd
loginctl enable-linger $(whoami)       # keep them running after you log out (see below)
systemctl --user reload sekurircd      # same as --rehash
journalctl --user -u sekurircd -f

The optional stats panel runs on the server with services (the hub) and has its own unit:

cp ~/.config/sekurircd/stats.template.toml ~/.config/sekurircd/stats.toml   # set [collector] enabled = true
python3 ~/.local/lib/sekurircd/stats/netstats.py -c ~/.config/sekurircd/stats.toml --user --admin --add yourname
systemctl --user enable --now netstats

Turn linger on. A user unit only runs while its user has a login session. With linger off, the ircd and services stop 10 seconds after your last SSH session closes (every user is disconnected, and an SSH client that reconnects does it again each time) and only start at your next login. loginctl enable-linger $(whoami) once (some systems want sudo) and they keep running after logout and start at boot. tools/upgrade.py checks it and says so when it is off. make uninstall removes binaries and units but leaves your config and state. Override PREFIX, SYSCONFDIR, STATEDIR or UNITDIR on the make command line to relocate any of it.

containers (podman, docker)

A prebuilt image with the ircd, services (NickServ + ChanServ), the stats panel and the config tools: ghcr.io/gcanosa/sekurircd, for x86-64 and arm64 (a Raspberry Pi 3, 4 or 5 on a 64-bit OS pulls it instead of compiling). CI builds it on both architectures, runs a smoke test in it (config wizard, ircd + services + panel, restart, rehash, graceful stop) and publishes it only after every platform above passes. 32-bit ARM (armv7) is not supported.

install with podman

git clone https://github.com/gcanosa/SekurIRCd.git && cd SekurIRCd
container/setup.sh install

setup.sh needs podman 5.0 or newer and a systemd Linux, and runs as your own user (the containers are rootless). It:

  1. checks the machine, then pulls the image (latest unless you pass --image, see choosing the image);
  2. asks where to keep your data (default ~/sekurircd);
  3. runs the config wizard inside the container and checks what it wrote before saving it;
  4. installs three systemd user units (ircd, services, stats panel) and starts them;
  5. turns on linger, so they start at boot and keep running after you log out, and checks that the ircd answers on its port.

choosing the image

All three containers run the same image, ghcr.io/gcanosa/sekurircd. The tag decides which code you get:

TagWhat it isUse it for
latestthe newest release. The defaulta production server
1.3the newest patch release of 1.3 (1.3.6, then 1.3.7, ...)production, bug fixes only
1.3.6exactly that release, it never changesproduction you want pinned, and rolling back
edgethe newest commit on main whose CI passed on every platform; it can be ahead of the last releasetrying what is coming

Right after a release, edge and latest hold the same code but are different builds: edge reports 1.3.6-git.20261125, the release reports 1.3.6. Nothing updates by itself: your machine keeps the copy of the tag it pulled until you run upgrade. container/setup.sh status prints the image and version in use; podman ps shows the image of each container.

The tag is set at install (--image, or SEKURIRCD_IMAGE) and then lives in the Image= line of the three units in ~/.config/containers/systemd/. To change it, edit all three, pull the new tag and restart:

NEW=ghcr.io/gcanosa/sekurircd:latest                  # or :1.3, :1.3.6, :edge
sed -i "s|^Image=.*|Image=$NEW|" ~/.config/containers/systemd/sekurircd-*.container
systemctl --user daemon-reload
podman pull $NEW
container/setup.sh restart services                   # nobody is disconnected
container/setup.sh restart stats
container/setup.sh restart ircd                       # this one drops everyone: pick your moment

start, stop and restart

container/setup.sh status                       # what runs, the image, the version
container/setup.sh start                        # all three; stop and restart work the same way
container/setup.sh restart ircd                 # or one of them: ircd | services | stats
container/setup.sh rehash                       # re-read the config, nobody is disconnected
container/setup.sh logs ircd                    # follow a log (ircd | services | stats)
ContainerWhat happens when you stop or restart it
ircdA graceful shutdown: every user is disconnected and linked servers see a split. Always-on sessions come back with it, and services reconnect to it by themselves.
servicesNickServ and ChanServ are gone for a few seconds (no registering or identifying meanwhile). Nobody is disconnected.
statsOnly the dashboard stops. The network is not affected.

upgrade

container/setup.sh backup
container/setup.sh upgrade

upgrade pulls the tag your units use and, if that brought a newer image:

  1. restarts services and the stats panel at once, without disconnecting anyone;
  2. asks before restarting the ircd, because that drops every user (always-on sessions come back, linked servers reconnect). Say no and the ircd keeps running the old version until you run container/setup.sh restart ircd.

Check the result with container/setup.sh status. Updates are never automatic: restarting an IRC server is your call.

Switching tags is not an upgrade. If the pull brings nothing new, upgrade says "already up to date" and restarts nothing. It compares the tag in your units with itself, so after changing the tag use the recipe under choosing the image.

your data and the network

docker and compose

Docker, podman older than 5.0, or a machine with no systemd user session: container/compose.yaml runs the same three containers (services and the panel are Compose profiles). Run these in the container/ directory:

export SEKURIRCD_UID=$(id -u) SEKURIRCD_GID=$(id -g)     # the containers run as you, so the data directory stays yours
mkdir -p data
docker compose run --rm -it ircd makeconf                # the config wizard
docker compose up -d                                     # the ircd
docker compose --profile services --profile stats up -d  # add services and the stats panel

docker compose restart ircd                              # restart one (the ircd drops everyone)
docker compose pull                                      # upgrade: pull the new image ...
docker compose --profile services --profile stats up -d --no-deps services stats   # ... services and the panel first
docker compose up -d ircd                                # ... the ircd when you are ready

SEKURIRCD_IMAGE (shell or a .env file next to compose.yaml) sets the tag and SEKURIRCD_DATA the data directory (default ./data).

The step-by-step guide (the same steps by hand, where each file lives, TLS certificates, troubleshooting) is container/README.md.

windows

Two ways: build it with Cygwin (the same code, running on Cygwin's POSIX layer), or run the Linux build inside WSL2. WSL2 is the better fit for a server that stays up; Cygwin needs no virtual machine.

cygwin

Install Cygwin with the packages gcc-core make libssl-devel python312 git, then in a Cygwin terminal:

git clone https://github.com/gcanosa/SekurIRCd.git && cd SekurIRCd
make
make check

The binaries run from a Cygwin terminal and need cygwin1.dll and the OpenSSL DLLs from the Cygwin install next to them (they are in C:\cygwin64\bin). Open the ports in Windows Defender Firewall (New-NetFirewallRule, as in the WSL2 steps below), and use the Task Scheduler to start it with Windows. The process stats line in the debug channel reports memory but not CPU. make install (systemd) is Linux only; run the binaries directly, as in run.

wsl2

Run the Linux build inside WSL2: it's the same code and the same steps as on Linux.

# PowerShell as Administrator, then reboot
wsl --install -d Ubuntu

# inside Ubuntu
sudo apt update && sudo apt install -y build-essential libssl-dev git
git clone https://github.com/gcanosa/SekurIRCd.git && cd SekurIRCd && make

Then follow run or the systemd user service above. For systemd, turn it on in WSL first: put [boot] / systemd=true in /etc/wsl.conf, run wsl --shutdown from PowerShell, reopen Ubuntu, and also run loginctl enable-linger $(whoami).

Networking. By default WSL2 sits behind NAT: Windows itself reaches the server on localhost, but other machines can't. For a server others connect to, use mirrored networking (Windows 11 22H2 or later), so WSL shares the Windows network interfaces. Put this in %UserProfile%\.wslconfig, then run wsl --shutdown:

[wsl2]
networkingMode=mirrored

Then open the ports in Windows (PowerShell as Administrator). Use the ports you configured: client, TLS, WebSocket and the [links] port.

New-NetFirewallRule -DisplayName "SekurIRCd" -Direction Inbound -Protocol TCP -LocalPort 6667,6697,7070 -Action Allow
# mirrored mode also filters WSL's own inbound traffic (Hyper-V firewall):
Set-NetFirewallHyperVVMSetting -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' -DefaultInboundAction Allow

Avoid the older netsh interface portproxy method: every client then appears to come from the Windows host's address, which breaks per-IP limits, K/Z-lines, the DNSBL and the proxy scanner.

Keeping it running. WSL shuts the Linux side down a while after the last Windows terminal into it closes, taking the daemons with it. To keep it up and start it with Windows, add a Task Scheduler task that runs at startup (whether the user is logged on or not): wsl.exe -d Ubuntu -- sleep infinity. With systemd on, that starts the daemons too.

next

Continue with configuration, or set up services (NickServ + ChanServ).