Raspberry Pi IRC Server
In this project, we will be showing you how to setup a Raspberry Pi IRC Server. An IRC server is perfect for the Raspberry Pi as compared to most other servers, as it is not hugely performance draining on the Raspberry Pi’s limited resources.

IRC for those who don’t know stands for Internet Relay Chat, it is one of the oldest chat protocols and even though it has fallen in popularity in recent years it is still the backbone of many communities. Even the popular streaming service, Twitch makes use of an IRC server to handle its chat. In fact we use the IRC protocol to interact with Twitch’s Chat network in our Raspberry Pi Twitch Bot tutorial.


There are quite a few different servers that you can set up on a Raspberry Pi and this is just one of them. If you like the idea of this be sure to check out some of our other server tutorials for the Raspberry Pi.

For this project, we will be utilizing Ircd-Hybrid as it is the most lightweight, high-performance and reliable IRC server that we have tested.

Equipment List

Below are all the bits and pieces that I used for this Raspberry Pi IRC Server tutorial, you will need an internet connection to be able to complete this tutorial.

Recommended:

Raspberry Pi 2 or 3

Micro SD Card

Ethernet Cord or Wifi dongle (The Pi 3 has WiFi inbuilt)

Optional:

Raspberry Pi Case

Installing and configuring the IRC Server

1. Before we get started with installing and setting up our Raspberry Pi IRC Server we will first run an update and upgrade to ensure our Raspberry Pi is completely up to date.

To do this run the following two commands in the terminal on your Raspberry Pi:

sudo apt-get update
sudo apt-get upgrade

2. With our Raspberry Pi now up to date we can proceed with installing the IRC Server software onto it.

We are using a piece of software called Ircd-Hybrid which is a very lightweight, stable and high-performance IRC server. All three of which are perfect characteristics for the Raspberry Pi’s limited resources.

To install the software for our Raspberry Pi IRC Server, type the following command into terminal.

sudo apt-get install ircd-hybrid

3. To setup oping on our IRC Server, we will also need to set a password. ircd-hybrid requires this password to be encrypted, we can use the following command to encrypt the password. Make sure you switch out password for your own and save the result as we will need this later

/usr/bin/mkpasswd password

4. Once the installation has completed we can proceed with configuring the Ircd-Hybrid software. To do this we will need to edit the ircd.conf file within the /etc/ircd-hybrid folder.

To do this we can simply run the following command in terminal to load up nano and begin editing the file.

sudo nano /etc/ircd-hybrid/ircd.conf

5. Within this file you will notice a huge amount of different options that you can configure in here. We will quickly change some of these configurations and explain why to give you an idea what they are for.

Thankfully the configuration file is pretty easy to understand due to a large number of comments so if there is anything you ever need to edit, just read the comments around it.

Within the serverinfo { block

Find

name = "hybrid8.debian.local";

Replace With

name = "pimylifeup.irc";

This defines the name for your IRC server, you can set this to whatever you like. As an example, for our tutorial we will set this to pimylifeup.irc.

Find

description = "ircd-hybrid 8.1-debian";

Replace With

description = "Raspberry Pi IRC Server";

This sets the servers description and will be what people see when they connect to your server.

Find

network_name = "debian";
network_desc = "This is My Network";

Replace With

network_name = "pimylifeup";
network_desc = "This is my Raspberry Pi IRC Network";

This is for describing the name and description of the network that your server is on.

Find

max_clients = 512;

Replace With

max_clients = 128;

This defines the maximum amount of people that can be connected to the IRC Server.

Within the operator { block

Find and remove

#

This section requires uncommenting, remove the first layer of #, if you see ## only remove the first one.

Find

name = "sheep";

Replace With

name = "op";

This defines the name of the operator group, we will use op as it is easiest to remember, you can set this to whatever you want.

Find

user = "*@192.0.2.240/28";

Replace With

user = "*@*";

This will change it so that anyone connecting to the server can run the oper command. If you want to restrict this to local users only you can try using something like “*@192.168.*.*“.

Find

password = "xxxxxxxxxxxxx";

Replace With

password = "REPLACE WITH YOUR ENCRYPTED PASSWORD";

Here we will want to replace the default password with the one that we encrypted earlier in the tutorial with the /usr/bin/mkpasswd tool. Remember this is not the plain text version of your password, it is the scrambled form.

6. Now we can save and quit out of the file by pressing Ctrl +X then pressing Y and then Enter.

7. With that now done you can modify the message of the day (MOTD) for the IRC Server. This is fairly easy to modify as the ircd-hybrid software reads it from a file called ircd.motd that is located in the /etc/ircd-hybrid folder.

You can begin modifying this file by running the following command in terminal:

sudo nano /etc/ircd-hybrid/ircd.motd

For our tutorial we will skip modifying this file, but basically whatever is in it will be displayed to a user upon connecting with the server.

8. Now that we have done our initial configuration of our Raspberry Pi IRC Server we will need to restart the server software. This is easily done by running the following command in terminal.

sudo /etc/init.d/ircd-hybrid restart

Connecting to your IRC Server

Now that we have configured our Raspberry Pi IRC Server we can now test to make sure it works. We will go through steps on connecting to the server using an IRC client on Windows to give you an idea of how to utilize your server.

For Windows we will be utilizing the popular mIRC client.

1. To start off first download and install the mIRC client, you can download it by going to mIRC’s homepage.

2. Once mIRC has finished installing, launch it. Once launched click File -> Select Server (Or press Alt + E)

3. A new windows should now pop up, on here you want to click the “Add” button.

4. Yet another window should load up, this time you will need to fill out the Description: and the Address: textboxes.
For “Description:” we chose to use pimylifeup, make sure you choose something that makes it stand out from the rest of the IRC servers.

For “Address:” we need to set this to the IP of our Raspberry Pi, if you don’t know the IP of your Raspberry Pi try typing the command hostname -I into its terminal. In our example, we will be using 192.168.0.143.

Once you have filled out this information, click the “Add” button.

5. Your server should now be added to mIRC’s list of IRC servers. It should also now already be selected, if it isn’t look for your new addition, it will be under the name you set for “Description:” in our case we would find it under the name pimylifeup.

Once you are certain you have it selected, press the “Select” button.

6. You will finally be brought to one final screen before making the connection, here you will want to set your “Nickname:” to whatever you want. Now before you jump ahead and press the “Connect” button make sure your server description name is next to “Server:

Once you are sure it is correct, click the “Connect” button.

7. Finally, type in the channel name you want to use, this can be anything as long as it starts with a #, once typed in all you need to do is click the “Join” button.

If all has gone well you should now be successfully connected to your Raspberry Pi IRC Server.

OPing yourself on your Raspberry Pi IRC Server

1. To OP yourself on your IRC server you need to remember the group name and the unencrypted password that you set earlier in this tutorial.

Once you have both handy, connect to your IRC server.

2. Once connected to your IRC server and you are in a channel, type in the command below into chat. Make sure that you replace op with your group name and replace password with the password you set earlier in this tutorial when you ran the /usr/bin/mkpasswd command.

3. You should see “You are now an IRC operator” appear in chat if you have been successfully made an operator.

Hopefully by now you have a fully functioning IRC Server running on your Raspberry Pi, including the ability to be able to set yourself as an operator. It’s quite a cool way to have your own private chat server that you can share with your family and friends.

Don’t forget to drop a comment below if this Raspberry Pi IRC server tutorial helped you out or whether you run into any issues. Don’t forget to check out our numerous other fun Raspberry Pi projects available on our website.

The Raspberry Pi Crash Course

The Raspberry Pi Crash Course

Enter your email address below to get the

Raspberry Pi crash course delivered straight to your inbox

Please check your inbox for a confirmation email!