ZNC is an advanced IRC network bouncer that is left connected all the time so that an IRC client can disconnect or reconnect without losing the chat session.
In this tutorial, we’ll compile ZNC with the web admin module installed.
First of all, and as always, we’ll update the package cache.
sudo apt-get updateNext, we’ll install some dependencies required to compile ZNC.
sudo apt-get install libssl-dev libperl-dev pkg-config build-essentialDownload the latest release of ZNC:
cd /usr/local/src
sudo wget http://znc.in/releases/znc-latest.tar.gzExtract ZNC from the tarball, and then enter the source directory:
sudo tar xf znc-latest.tar.gz
cd znc-*/At this step, you can set ZNC’s installation directory by adding the --prefix=<yourdir> option. But for now, we’ll install it system-wide:
./configureWe’ll compile ZNC and install it with the following commands. To speed up the process, you may add -j n to the first make command, where n is the number of cores / vCPUs on your Server.
sudo make
sudo make installThis may take a few minutes, depending on your machine’s configuration.
It is important not to run web-facing apps under root. So we’ll create a new user for ZNC.
adduser --disabled-password zncNow switch to ZNC.
su znc -
cd ~Create ZNC’s config file under znc:
/usr/local/bin/znc --makeconfZNC will ask us some questions to create the config file. The first one is important; note your input because you will connect to the ZNC daemon using that port.
We’ll enter 6697 now – that’s the default port for IRC with SSL/TLS.
[ ?? ] What port would you like ZNC to listen on? (1025 to 65535): 6697It is strongly recommended to enable SSL listening instead of the plain-text (i.e., insecure) scheme.
Would you like ZNC to listen using SSL? (yes/no) [no]: yesThe next question is regarding IPv6. That depends on your needs. If your home network is IPv6-enabled, it’s recommended to enable it. We’ll just leave the default option there.
[ ?? ] Would you like ZNC to listen using both IPv4 and IPv6? (yes/no) [yes]: <press Enter>Now it’ll prompt us about two global modules, partyline and webadmin. They’re self-explanatory, and we’ll need to enable them.
[ ?? ] Load global module <partyline>? (yes/no) [no]: yes
[ ?? ] Load global module <webadmin>? (yes/no) [no]: yesUser creation. Enter your desired username and password for the user, then confirm it. Note that the password will not be echoed.
[ ?? ] Username (AlphaNumeric): Doe
[ ?? ] Enter Password: <password>
[ ?? ] Confirm Password: <password>Grant the user admin permissions:
[ ?? ] Would you like this user to be an admin? (yes/no) [yes]: yesThen, your IRC network options. Set it on your own. Here’s an example:
[ ?? ] Nick [Doe]: Doe
[ ?? ] Alt Nick [Doe_]: Doe_
[ ?? ] Ident [Doe]: DoeIdent
[ ?? ] Real Name [Got ZNC?]: Jane Doe
[ ?? ] Bind Host (optional): server.hostname
[ ?? ] Number of lines to buffer per channel [50]: 50
[ ?? ] Would you like to clear channel buffers after replay? (yes/no) [yes]: yesEnable these modules:
[ ?? ] Load module <chansaver>? (yes/no) [no]: yes
[ ?? ] Load module <controlpanel>? (yes/no) [no]: yes
[ ?? ] Load module <perform>? (yes/no) [no]: yes
[ ?? ] Load module <webadmin>? (yes/no) [no]: yesNow we may set up the IRC network that ZNC will connect to.
[ ?? ] Would you like to set up a network? (yes/no) [no]: yesWe’ll use #ubuntu it on Freenode, for example.
Network (e.g., 'freenode' or 'efnet'): freenodeInformation about these network modules is provided here.
[ ?? ] Load module <chansaver>? (yes/no) [no]: yes
[ ?? ] Load module <keepnick>? (yes/no) [no]: yes
[ ?? ] Load module <kickrejoin>? (yes/no) [no]: yes
[ ?? ] Load module <kickrejoin>? (yes/no) [no]: yes
[ ?? ] Load module <nickserv>? (yes/no) [no]: yes
[ ?? ] Load module <perform>? (yes/no) [no]: yes
[ ?? ] Load module <simple_away>? (yes/no) [no]: yesSet the server we’ll connect to:
[ ?? ] IRC server (host only): irc.freenode.net
[ ?? ] [irc.freenode.net] Port (1 to 65535) [6667]: 6697
[ ?? ] [irc.freenode.net] Password (probably empty):
[ ?? ] Does this server use SSL? (yes/no) [no]: yes
[ ** ]
[ ?? ] Would you like to add another server for this IRC network? (yes/no) [no]: noAnd the channel we’ll join:
[ ?? ] Would you like to add a channel for ZNC to automatically join? (yes/no) [yes]: yes
[ ?? ] Channel name: #ubuntu
[ ?? ] Would you like to add another channel? (yes/no) [no]: noFinish the configuration and launch ZNC:
[ ?? ] Would you like to set up another user? (yes/no) [no]: no
[ .. ] Writing config [/home/znc/.znc/configs/znc.conf]...
[ >> ] ok
... ...
[ ?? ] Launch ZNC now? (yes/no) [yes]: yesYay. ZNC is up and running!