
How To Install ZNC, an IRC Bouncer, on Ubuntu 24.04 or Newer
Welcome to the Greenhost.cloud blog! Today, we’re diving into the world of Internet Relay Chat (IRC) and exploring how to install ZNC, a popular IRC bouncer, on Ubuntu 24.04 or newer. Whether you’re a seasoned IRC user or just getting started, ZNC can help you manage your IRC connections more efficiently, allowing you to stay connected even when you’re offline.
What is ZNC?
ZNC is an advanced IRC bouncer that acts as a bridge between your IRC client and the IRC servers. It maintains your connection to the server, logs your conversations, and allows you to connect from multiple devices without losing messages. This is especially useful for users who are frequently on the go or who use different devices to access IRC.
Prerequisites
Before you start the installation process, ensure that you have:
- A server running Ubuntu 24.04 or newer.
- Access to the terminal with sudo privileges.
- Basic familiarity with the command line.
Step 1: Update Your System
First, it’s essential to ensure your system is up to date. Open your terminal and run the following commands:
sudo apt update
sudo apt upgrade -y
This will refresh your package list and install any available updates.
Step 2: Install Required Dependencies
ZNC requires a few packages to run smoothly. Install the necessary dependencies by executing:
sudo apt install build-essential pkg-config libssl-dev libperl-dev libjson-perl libxml2-dev libsqlite3-dev -y
These packages include development tools and libraries needed for compiling and running ZNC.
Step 3: Download and Install ZNC
Now, let’s download the latest version of ZNC. You can find the latest release on the ZNC GitHub page. At the time of writing, the latest version is 1.8.2, but make sure to check for any updates.
To download and install ZNC, run the following commands:
cd /tmp
wget https://github.com/znc/znc/archive/refs/tags/1.8.2.tar.gz
tar -xzf 1.8.2.tar.gz
cd znc-1.8.2
./configure
make
sudo make install
This process will configure, compile, and install ZNC on your system.
Step 4: Create a ZNC User
For security reasons, it’s a good practice to run ZNC under its own user account. Create a new user by running:
sudo adduser --system --group znc
This command will create a system user named znc
that will manage the ZNC service.
Step 5: Configure ZNC
Now that ZNC is installed, you need to configure it. To do this, switch to the ZNC user and run the following command:
sudo -u znc znc --makeconf
This will launch a configuration wizard that will guide you through the setup process. You’ll be prompted to enter details like your nickname, server information, and whether you want to enable admin access. Follow the prompts, and when you’re done, ZNC will create a configuration file in ~/.znc/configs/
.
Step 6: Start ZNC
You can start ZNC using the command:
sudo -u znc znc
To ensure ZNC runs in the background, you might want to create a service file.
Step 7: Create a Systemd Service (Optional)
To run ZNC as a service, create a systemd service file:
sudo nano /etc/systemd/system/znc.service
Add the following content to the file:
[Unit]
Description=ZNC IRC Bouncer
After=network.target
[Service]
Type=simple
User=znc
ExecStart=/usr/local/bin/znc -f
Restart=on-failure
[Install]
WantedBy=multi-user.target
Save and exit the file. Then, enable and start the ZNC service:
sudo systemctl enable znc
sudo systemctl start znc
You can check the status of ZNC with:
sudo systemctl status znc
Step 8: Access ZNC Web Interface
ZNC comes with a web administration interface that can be accessed through your web browser. By default, it runs on port 8080. Open your browser and navigate to:
http://your-server-ip:8080
Log in using your credentials, and you’ll be able to manage your IRC connections easily.
Conclusion
Congratulations! You’ve successfully installed ZNC on your Ubuntu 24.04 or newer server. With ZNC, you can now enjoy a seamless IRC experience across multiple devices and keep your conversations logged even when you’re offline. If you have any questions or run into any issues, feel free to leave a comment below!
For more tutorials and tips on managing your cloud services, stay tuned to the Greenhost.cloud blog!