How to Install and Set Up ZNC on CentOS 7
ZNC is a free and open-source IRC bouncer that maintains a constant connection to an IRC network, allowing clients to catch up on messages they missed while offline.
This guide will take you step by step through installing and configuring ZNC on a CentOS 7 system. Note that it assumes familiarity with configuring the firewall. CentOS 7 uses FirewallD, which, by default, blocks all incoming connections—even if you’ve already configured web-based settings.
Installing ZNC
Setting up ZNC is relatively simple but requires enabling the Extra Packages for Enterprise Linux (EPEL) repository first.
You can find detailed instructions for enabling EPEL in the official documentation.
Once EPEL is enabled, install ZNC by running the following command:
yum install znc
Setting Up ZNC
To avoid potential security risks, it’s not advisable to run publicly accessible services as the root user. Instead, use a dedicated user account for remote applications. Fortunately, when you install ZNC from the repository, it automatically creates this user for you—so no manual setup is needed here.
After installation, initiate the configuration wizard with:
sudo -u znc znc --makeconf
The wizard will prompt you to set a listening port. This is the port you’ll use to access ZNC (including its web interface). Port 6697 is a common choice for secure IRC connections, so that’s a good option to use.
[ ?? ] Listen on port (1025 to 65534): 6697
Next, you’ll be asked if you’d like to enable SSL. It’s strongly recommended to say “yes” here, as SSL encrypts traffic and prevents others on the same network from intercepting your messages.
[ ?? ] Listen using SSL (yes/no) [no]: yes
Then, ZNC will inquire if you want to support both IPv4 and IPv6. Since there’s no downside and IPv6 is increasingly becoming the standard, it’s safe to just press Enter and accept the default “yes.”
[ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]:
If ZNC hasn’t been installed on this machine before, it will notify you about a missing file. Don’t worry—this is expected behavior, and ZNC will automatically create the necessary file during setup.
You’ll then be asked to enter a username for the administrative account. Feel free to choose any name, but it must be made up of only alphanumeric characters.
[ ?? ] Username (alphanumeric):
After that, set a password. Choose something secure. Note that as you type the password, it won’t be visible on the screen for security reasons.
[ ?? ] Enter password:
[ ?? ] Confirm password:
Defining User Identity in ZNC
Next, ZNC will prompt you to set a “nick,” which is your visible nickname on IRC. By default, it uses your chosen username. Feel free to select a nickname you prefer—this can be changed later if needed.
[ ?? ] Nick [example]:
You will also be asked for an alternate nickname, which serves as a fallback if your primary nick is already taken. By default, it appends an underscore to your main nick.
[ ?? ] Alternate nick [example_]:
Next is the “ident” field. Some IRC clients, such as HexChat, refer to this as the “username.” This identifier appears before your hostname in WHOIS lookups. For instance, if your ident is example
and your host is example.com
, it will show as example@example.com
. This field defaults to the username you previously created.
[ ?? ] Ident [example]:
You’ll then be asked to enter a real name. Despite the name, this field doesn’t have to contain your actual name. By default, ZNC sets it to “Got ZNC?” Some IRC clients may use “realname” as a placeholder. You may leave the default or change it to whatever you prefer.
[ ?? ] Real name [Got ZNC?]:
Adding a Network Configuration
ZNC will then ask if you’d like to configure an IRC network immediately. The default response is “yes.” You can choose to skip this if you prefer to set it up later.
[ ?? ] Set up a network? (yes/no) [yes]:
This walkthrough proceeds with the assumption that you have chosen to set up the network now.
You will be asked to provide a name for the network. This is the label ZNC will display for the IRC server you’re connecting to. By default, it suggests “freenode,” which was once a popular public IRC server.
[ ?? ] Name [freenode]:
Entering Server Details
You’ll next be prompted to input the IRC server’s hostname. Just enter the host—do not include the port number.
[ ?? ] Server host (host only):
ZNC will then ask whether the IRC server supports SSL connections. You’ll need to find this information on your own, as it depends on the server you plan to connect to.
[ ?? ] Server uses SSL? (yes/no) [no]:
The following prompt requests the server’s port number. If you’ve enabled SSL, the default will be 6697
; otherwise, it defaults to 6667
. Here’s an example with SSL enabled:
[ ?? ] Server port (1 to 65535) [6697]:
Now you’ll be asked to enter a password for the IRC server. If no password is required, simply leave the field blank and press Enter to proceed.
[ ?? ] Server password (probably empty):
Finally, you can specify any IRC channels you want ZNC to auto-join when connecting. You may skip this by pressing Enter if you prefer not to set any.
[ ?? ] Initial channels:
Finishing Up the Setup
Once you’ve completed all previous steps, ZNC will display instructions for connecting and managing your setup. You’ll see something like the following in your terminal:
[ ** ] 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> +6697 example:<pass>
[ ** ]
[ ** ] To manage settings, users and networks, point your web browser to
[ ** ] https://<znc_server_ip>:6697/
The very last prompt will ask if you’d like to start ZNC immediately. Confirm with “yes” unless you have a reason to delay launching the service.
[ ?? ] Launch ZNC now? (yes/no) [yes]:
Conclusion
Installing and configuring ZNC on CentOS 7 gives you a powerful and reliable IRC bouncer that ensures you never miss messages, even while offline. With built-in SSL support, web-based configuration, and support for multiple networks, ZNC is an excellent choice for IRC power users. After completing this guide, you’re ready to enjoy a persistent and secure IRC experience.