ZNC is an IRC network bouncer or BNC. It can detach the client from the actual IRC server, and also from selected channels.
There are several possibilities to install ZNC on your machine. The latest version is always available using the source tarball from https://znc.in/releases.
- Which way should I choose for installing ZNC?
- If you don't have root access, the only way is to use source tarball. You'll need to use
./configure --prefix="$HOME/.local"
as described. - If you have root access, you can use either source tarball or the convenient way for your distro. Check section about your distro for details, but be aware that these may contain old versions of ZNC!
If you want to compile ZNC with OpenSSL support, you need the OpenSSL development package. On Debian/Ubuntu this is called libssl-dev, on CentOS/Fedora/Red Hat it's openssl-devel, and on openSUSE it's libopenssl-devel. A good way to install this and other dependencies is the build dependency feature of package managers (apt-get build-dep
/ yum-builddep
/ zypper source-install --build-deps-only
).
- Download the latest source tarball
tar -xzvf znc-1.8.2.tar.gz
cd znc-1.8.2
mkdir build
cd build
./configure
make
(if you are on a dedicated server and your CPU has more than one core, you can usemake -jX
where X is the number of CPU cores to speed up compilation)make install
How to configure ZNC
To generate a basic configuration file, run znc --makeconf
after installation. It is NOT a good idea to create a new config file manually.
File locations
- Configuration - ZNC gets its configuration by reading the file
~/.znc/configs/znc.conf
. - Misc - Other files are also stored in the
~/.znc
directory, such as the SSL certificate (znc.pem) and the PidFile (znc.pid). - Local Modules - Stored in
~/.znc/modules
. ZNC will look in the local module directory first when trying to load a module. - Global Modules - Stored in
/usr/local/lib/znc
by default (where/usr/local
is the prefix you chose). This is/usr/lib/znc
if you used the Debian package. - Binaries -
znc
,znc-config
, andznc-buildmod
are all stored in/usr/local/bin
(or in/usr/bin
) by default. You can change this when you configure by using./configure --prefix=/whatever/path/you/want
.
Editing config
In most cases you should NOT edit znc.conf directly. Use webadmin instead.
If you really need to edit znc.conf by hand, do the following:
- pkill -SIGUSR1 znc
- to save current runtime configuration to znc.conf
- pkill znc
- to shutdown running ZNC instance
- Edit znc.conf
- znc
- to start it again with new configuration
Config file structure
The following pseudo content illustrates the config structure with single listener, user, network and channel. Naturally, there can be multiple instances of each.
Key = Value <Listener name> Key = Value </Listener> <User name> Key = Value <Network name> Key = Value <Chan name> Key = Value </Chan> </Network> <Pass password> Key = Value </Pass> </User>