Home / Journal

How to Set Up and Manage a ZNC IRC Bouncer

How to Set Up and Manage a ZNC IRC Bouncer

If you use IRC, you've felt the pain: close your laptop and you drop off the network, lose your place in busy channels, and miss everything said while you were gone. A bouncer fixes that. ZNC is the most popular one — it sits on an always-on server, stays connected to IRC for you, buffers messages while you're away, and lets you attach from any client (desktop, phone, another machine) and pick up exactly where you left off.

Let me walk you through setting one up and the commands you'll use to run it.

Installing ZNC

On Debian / Ubuntu:

sudo apt install znc

On Fedora / RHEL:

sudo dnf install znc

On macOS (with Homebrew):

brew install znc

First-time configuration

ZNC ships with an interactive setup wizard that writes your config and generates a TLS certificate for you. Run it as the user that will own ZNC:

znc --makeconf

It walks you through the essentials:

Listen on port .......... 6697
Listen using SSL ........ yes
Username ................ yourname
Password ................ ********
Make this user an admin . yes
Nick / Alt nick / Ident . yourname
Set up a network now .... yes
  Network name .......... libera
  Server host ........... irc.libera.chat
  Server port ........... 6697  (SSL)
Launch ZNC now .......... yes

A few notes on the answers:

  • Port 6697 with SSL is the sensible default — your client-to-bouncer traffic is then encrypted.
  • The username and password here are your bouncer login, separate from your IRC nick.
  • You can add more networks later, so don't worry if you only set up one now.

Running ZNC as a service

The wizard can launch ZNC immediately, but on a server you want it to start on boot and restart if it crashes. Create a systemd service (running as a dedicated znc user is good practice):

sudo useradd -r -m -d /var/lib/znc znc

Then create /etc/systemd/system/znc.service:

[Unit]
Description=ZNC IRC bouncer
After=network-online.target
Wants=network-online.target

[Service]
User=znc
ExecStart=/usr/bin/znc --foreground --datadir /var/lib/znc
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable and start it:

sudo systemctl enable --now znc

Note: If you set up ZNC with znc --makeconf under your own account, its config lives in ~/.znc. The service above uses /var/lib/znc as the data directory — point --datadir at wherever your configs/znc.conf actually is.

Connecting your IRC client

Point your client (HexChat, irssi, Textual, a mobile app — anything) at your bouncer instead of at the IRC network:

  • Server: your server's hostname or IP
  • Port: 6697
  • TLS/SSL: on
  • Server password: username:password — your ZNC login, not a NickServ password

If you set up more than one network, target a specific one by putting the network name in the password:

username/libera:yourpassword

That's the whole trick — your client thinks it's talking to IRC, but it's really talking to ZNC, which relays to the actual network and keeps the connection alive when you disconnect.

Managing ZNC day to day

You control a running ZNC by sending private messages to its built-in helper users — the ones whose names start with *. The two you'll use most are *status (the bouncer itself) and *controlpanel (settings).

Start with help, which lists every available command:

/msg *status help
/msg *controlpanel help

Most clients also accept /znc <command> as a shortcut for /msg *status <command>.

The *status commands you'll reach for:

ListNetworks        # show your networks and whether each is connected
Jump                # reconnect the current network
Disconnect          # disconnect from the current network
Detach #channel     # detach a channel (stay joined, stop receiving it)
PlayBuffer #channel # replay the saved backlog for a channel
ClearBuffer         # clear a channel's backlog
ListMods            # show loaded modules
Traffic             # data usage stats
SaveConfig          # write the running config to disk

To change your identity or add networks/servers without editing files, use *controlpanel:

/msg *controlpanel Set Nick    yourname newnick
/msg *controlpanel Set RealName yourname Some Real Name
/msg *controlpanel AddNetwork  yourname oftc
/msg *controlpanel AddServer   yourname oftc irc.oftc.net +6697

Prefer clicking to typing? ZNC has a web admin — load the webadmin module and visit https://your-server:6697/ in a browser, then log in with your ZNC username and password. Everything above is available as point-and-click.

Useful modules

Modules extend ZNC. Load one with /msg *status LoadMod <name> (or per-network with LoadNetModule). A few worth knowing:

  • chansaver — remembers the channels you join, so they persist across restarts.
  • controlpanel — the settings interface used above.
  • nickserv — auto-identifies to NickServ on connect.
  • log — writes per-channel logs to disk.

Note: simple_away (auto-away when you detach) is popular, but on some networks the AWAY command it sends when you re-attach resets your idle timer. If you care about idle time, skip it.

A few good habits

  • Always use SSL on both hops — client-to-bouncer and bouncer-to-network.
  • Use a strong, unique bouncer password (see Choosing Strong Passwords). It guards every network you've configured.
  • Don't expose it more than you must. A bouncer on a public port is a login prompt facing the whole internet — keep ZNC patched, or better, only reach it over a private network (a VPN or mesh like Tailscale) so the port isn't public at all.

That's everything you need to keep a persistent, always-on presence on IRC. Set it once, connect from whatever device is in front of you, and never miss the conversation again. Hope this helps!

References

← All articles