It is nice to have an IRC connection that is always available and that doesn’t have your home IP address exposed. With the ZNC setup you can then use your local IRC client (BitchX, irssi, HexChat etc) to connect to the ZNC and you will be able to see all the networks and channels it is connected to. This tutorial will explain how to setup ZNC on a $5/month DigitalOcean droplet (ref link) with Ubuntu 16.04.1. Of course this setup should work on any hosting and setup – DigitalOcean is just given as an example here.

Create a Droplet

1. Press on the Create a Droplet button once you are logged in your DO account

  • Select the OS image (Ubuntu 16.04.X), the Droplet size/price ($5/mo), data center region, add extra features, ssh key if you want that extra security and then press on Create Droplet

2. Login to your Droplet (box) and make sure everything is up to date

sudo apt-get update
sudo apt-get upgrade

Installation and Build of ZNC

1. Grab few essentials that are needed to compile the ZNC from source

sudo apt-get install build-essential libssl-dev libperl-dev pkg-config

2. Grab the latest ZNC source tar ball

cd /usr/local/src; sudo wget http://znc.in/releases/znc-latest.tar.gz

3. Extract the package and enter the directory

sudo tar -xzvf znc-latest.tar.gz; cd znc*

4. Configure the source system wide (you can use ./configure –prefix=$HOME/znc if you don’t want system wide)

./configure

5. Then, compile ZNC (might take few minutes)

sudo make; sudo make install

Configuration of ZNC

1. Create a new user on which we will run ZNC

adduser znc-admin

2. Switch to the new user

su znc-admin; cd ~

3. Start ZNC and its configuration

/usr/local/bin/znc --makeconf

4. Below is a sample configuration (ZNC version 1.6.4) – I highlighted in red all the config that I entered manually, the rest is the default values (what is given in the brackets [ ])

[ .. ] Checking for list of available modules...
[ >> ] ok
[ ** ] 
[ ** ] -- Global settings --
[ ** ] 
[ ?? ] Listen on port (1025 to 65534): 14125
[ ?? ] Listen using SSL (yes/no) [no]: yes
[ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]: yes
[ .. ] Verifying the listener...
[ >> ] ok
[ ** ] Unable to locate pem file: [/home/znc-admin/.znc/znc.pem], creating it
[ .. ] Writing Pem file [/home/znc-admin/.znc/znc.pem]...
[ >> ] ok
[ ** ] Enabled global modules [webadmin]
[ ** ] 
[ ** ] -- Admin user settings --
[ ** ] 
[ ?? ] Username (alphanumeric): redoEm
[ ?? ] Enter password: 
[ ?? ] Confirm password: 
[ ?? ] Nick [redoEm]: 
[ ?? ] Alternate nick [redoEm_]: 
[ ?? ] Ident [redoEm]: 
[ ?? ] Real name [Got ZNC?]: Redo'Em
[ ?? ] Bind host (optional): 
[ ** ] Enabled user modules [chansaver, controlpanel]
[ ** ] 
[ ?? ] Set up a network? (yes/no) [yes]: 
[ ** ] 
[ ** ] -- Network settings --
[ ** ] 
[ ?? ] Name [freenode]: 
[ ?? ] Server host [chat.freenode.net]: 
[ ?? ] Server uses SSL? (yes/no) [yes]: 
[ ?? ] Server port (1 to 65535) [6697]: 
[ ?? ] Server password (probably empty): 
[ ?? ] Initial channels: #redoEm
[ ** ] Enabled network modules [simple_away]
[ ** ] 
[ .. ] Writing config [/home/znc-admin/.znc/configs/znc.conf]...
[ >> ] ok
[ ** ] 
[ ** ] 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> +14125 redoEm:<pass>
[ ** ] 
[ ** ] To manage settings, users and networks, point your web browser to
[ ** ] https://<znc_server_ip>:14125/
[ ** ] 
[ ?? ] Launch ZNC now? (yes/no) [yes]: 
[ .. ] Opening config [/home/znc-admin/.znc/configs/znc.conf]...
[ >> ] ok
[ .. ] Loading global module [webadmin]...
[ >> ] [/usr/local/lib/znc/webadmin.so]
[ .. ] Binding to port [+34125]...
[ >> ] ok
[ ** ] Loading user [redoEm]
[ ** ] Loading network [freenode]
[ .. ] Loading network module [simple_away]...
[ >> ] [/usr/local/lib/znc/simple_away.so]
[ .. ] Adding server [chat.freenode.net +6697 ]...
[ >> ] ok
[ .. ] Loading user module [chansaver]...
[ >> ] ok
[ .. ] Loading user module [controlpanel]...
[ >> ] ok
[ .. ] Forking into the background...
[ >> ] [pid: 19576]
[ ** ] ZNC 1.6.4 - http://znc.in

That is it – ZNC is now up and running!

Connect to ZNC with your local IRC Client

Now find the IP address from your Droplet and setup your IRC client to connect to it.

Example with HexChat:

After connecting to the ZNC all the networks and channels you have added will appear.