Installing ZNC from source on Linux

In this article I will explain how to install ZNC from source in Ubuntu/Debian, and CentOS/Fedora/Red Hat Linux.

#### Ubuntu/Debian: (I recommend installing as root if possible, or using sudo otherwise).

  1. First, install the required dependencies.
apt-get install build-essential libssl-dev libperl-dev pkg-config
  1. Next, install the OpenSSL Development package, which is required to use SSL with ZNC.
apt-get install libssl-dev
  1. cd to wherever you want to download the source files and download the latest znc version (ver. 1.8.1 at the time of writing).
cd ~/downloads   
wget http://znc.in/releases/znc-latest.tar.gz
tar -xzvf znc*.*gz
cd znc*
./configure && make && make install

#### CentOS/Fedora/Red Hat

(I recommend installing as root if possible, or using sudo otherwise).

  1. Install GCC if you don't have it.
yum install gcc 
  1. Install the following openSSL packages to enable SSL.
yum install openssl openssl-devel
  1. cd to wherever you want to download the source files and download the latest version (ver. 1.8.1 at the time of writing).
cd ~/downloads   
wget http://znc.in/releases/znc-latest.tar.gz
tar -xzvf znc*.*gz
cd znc*
./configure && make && make install

Configuration

It is important not to run web-facing apps under root. So we'll create a new user for ZNC.

adduser znc

Now switch to znc.

su znc -
cd ~

Create ZNC's config file under znc:

/usr/local/bin/znc --makeconf

ZNC will ask us some questions in order 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): 6697

It 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]: yes

Next question is regarding IPv6. That actually depends on your needs. If your home network is IPv6 enabled, it's recommended to enable. 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]: yes

User creation. Enter your desired username and password for the user, then confirm it. Note that the password will not be echoed.

[ ?? ] Username (AlphaNumeric): Nick
[ ?? ] Enter Password: <password>
[ ?? ] Confirm Password: <password>

Grant the user admin permissions:

[ ?? ] Would you like this user to be an admin? (yes/no) [yes]: yes

Then, your IRC network options. Set it on your own. Here's an example:

sisrv@server2:~$ znc --makeconf

[ .. ] Checking for list of available modules...
[ ** ]
[ ** ] -- Global settings --
[ ** ]
[ ?? ] Listen on port (1025 to 65534): 22220
[ ?? ] Listen using SSL (yes/no) [no]: yes
[ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]: yes
[ .. ] Verifying the listener...
[ ** ] Unable to locate pem file: [/home/sisrv/.znc/znc.pem], creating it
[ .. ] Writing Pem file [/home/sisrv/.znc/znc.pem]...
[ ** ] Enabled global modules [webadmin]
[ ** ]
[ ** ] -- Admin user settings --
[ ** ]
[ ?? ] Username (alphanumeric): sisrv
[ ?? ] Enter password:
[ ?? ] Confirm password:
[ ?? ] Nick [DeviL]: DeviL
[ ?? ] Alternate nick [DeviL_]: DeviL-
[ ?? ] Ident [sisrv]: sisrv
[ ?? ] Real name (optional): www.sisrv.net
[ ?? ] Bind host (optional): your.IPv4.here
[ ** ] Enabled user modules [chansaver, controlpanel]
[ ** ]
[ ?? ] Set up a network? (yes/no) [yes]: yes
[ ** ]
[ ** ] -- Network settings --
[ ** ]
[ ?? ] Name [freenode]: SiSrv
[ ?? ] Server host (host only): irc.sisrv.net
[ ?? ] Server uses SSL? (yes/no) [no]: yes
[ ?? ] Server port (1 to 65535) [6697]: 6697
[ ?? ] Server password (probably empty):
[ ?? ] Initial channels: #SiSrv
[ ** ] Enabled network modules [simple_away]
[ ** ]
[ .. ] Writing config [/home/sisrv/.znc/configs/znc.conf]...
[ ** ]
[ ** ] To connect to this ZNC you need to connect to it as your IRC server
[ ** ] using the port that you supplied.  You have to supply your login info
[ ** ] as the IRC server password like this: user/network:pass.
[ ** ]
[ ** ] Try something like this in your IRC client...
[ ** ] /server <znc_server_ip> +22220 sisrv:<pass>
[ ** ]
[ ** ] To manage settings, users and networks, point your web browser to
[ ** ] https://<znc_server_ip>:22220/
[ ** ]
[ ?? ] Launch ZNC now? (yes/no) [yes]: yes
[ .. ] Opening config [/home/sisrv/.znc/configs/znc.conf]...
[ .. ] Loading global module [webadmin]...
[ .. ] Binding to port [+22220]...
[ ** ] Loading user [sisrv]
[ ** ] Loading network [SiSrv]
[ .. ] Loading network module [simple_away]...
[ >> ] [/usr/local/lib/znc/simple_away.so]
[ .. ] Adding 1 servers...
[ .. ] Loading user module [chansaver]...
[ .. ] Loading user module [controlpanel]...
[ .. ] Forking into the background...
[ >> ] [pid: 30219]
[ ** ] ZNC 1.8.2 - https://znc.in

Enable 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]: yes

via IRC ex: /znc LoadMod sasl or /znc LoadMod perform

Now we may setup the IRC network that ZNC will connect to.

[ ?? ] Would you like to set up a network? (yes/no) [no]: yes

We'll use #sisrv on SiSrv for example.

Network (e.g. 'sisrv' or 'efnet'): sisrv

Information about these network modules prompted are

[ ?? ] 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]: yes

Set the server we'll connect to:

[ ?? ] IRC server (host only): irc.sisrv.net
[ ?? ] [irc.sisrv.net] Port (1 to 65535) [6667]: 6697
[ ?? ] [irc.sisrv.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]: no

And the channel we'll join:

[ ?? ] Would you like to add a channel for ZNC to automatically join? (yes/no) [yes]: yes
[ ?? ] Channel name: #sisrv
[ ?? ] Would you like to add another channel? (yes/no) [no]: no

Finish 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]: yes

ZNC should be up and running!

  • znc from source, znc on linux, install znc
  • 101 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install psyBNC

psyBNC is small, lightweight software for usage in IRC (Internet Relay Chat). Bouncers have...

psyBNC FAQ

| psyBNC-FAQ (Frequently Asked Questions) for psyBNC | This FAQ does not...

Frequently Asked Questions

Frequently Asked Questions - up to version 2.3.2 Q: I tried to add a User for getting Op from...

How to recover psyBNC password

To reset password of your psybnc follow the steps mentioned below: Login to the shell account...

How to install sBNC

shroudBNC  or sBNC is a modular IRC proxy written in C++. It is capable of proxying IRC...

Powered by WHMCompleteSolution