How to Install ZNC on macOS

ZNC is a popular IRC client that runs on a server, known for its bouncer capabilities to maintain a persistent connection to IRC channels. In this tutorial, we will guide you through the process of installing ZNC on macOS.

Prerequisites

Before you start the installation process, ensure that your macOS has the following prerequisites:

If you do not have these prerequisites installed, you can easily install them using the following commands on your terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
xcode-select --install

Step 1: Install ZNC

The easiest way to install ZNC on macOS is through Homebrew. Run the following command on your terminal to install ZNC on your macOS:

brew install znc

Step 2: Configure ZNC

Once you've installed ZNC, you need to configure it to your preferences. Run the following command on your terminal to create a ZNC configuration file:

znc --makeconf

This will start a configuration wizard, where you can enter details such as your IRC nickname and server details.

Note that, during the configuration process, you will be prompted to set a username and password for your ZNC web interface, which you can use to access your ZNC bouncer via a web browser.

Step 3: Start ZNC

To start the ZNC bouncer, simply run the following command on your macOS terminal:

znc

When done, press CTRL+C to stop the ZNC bouncer.

Step 4: Add ZNC to System Startup

If you'd like ZNC to start automatically on system startup, you can use Homebrew's launchctl command to set it up.

First, you need to create a new plist file. Run the following command in your terminal to create the plist file:

nano ~/Library/LaunchAgents/com.znc.plist

This will open the nano text editor in your terminal, create the file if it doesn't exist, and allow you to modify it. Copy and paste the following configuration code into the file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.znc</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/znc</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

Save and close the nano text editor using CTRL+X, Y, and ENTER.

Next, load the plist file to configure automatic startup:

launchctl load ~/Library/LaunchAgents/com.znc.plist

Your ZNC bouncer will now start automatically on system startup.

Conclusion

In this tutorial, we guided you through the process of installing ZNC on your macOS using Homebrew. We also showed you how to configure and start the ZNC bouncer, as well as how to set it to start automatically on system startup.

With ZNC installed on your macOS, you can enjoy a persistent connection to your favorite IRC channels without having to remain constantly connected.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!