Raspberry Pi IRC Server: Setup your own Chat Network

In this project, we will be showing you how to set up a Raspberry Pi IRC Server.

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, then 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

Optional

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 the Raspbian operating system is completely up to date.

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

sudo apt update
sudo apt 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 the terminal.

sudo apt 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, and 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 line defines the name for your IRC server, and 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 line 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 line 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 line 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 line defines the name of the operator group, and 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 line 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 message is relatively easy to change 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 restart 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 already be selected, and if it isn’t, then 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, and 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.

6 Comments

  1. Avatar for Zero Flyer
    Zero Flyer on

    I have Pi 2 Model B, is it capable to drive this server? And is it possible to use ssd instead ov sd card?

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Zero,

      The Pi 2 Model B should more than capable enough to drive a small IRC server. IRC isn’t the most resource intensive thing to operate.

      Yes, you should be able to boot from a SSD drive as long as you have a USB connection for it.

      Please let me know if they helps.

      Kind regards,
      Emmet

  2. Avatar for Andre
    Andre on

    This guide is missing an important command. At the very end of the article, it doesn’t show the command we should use to make ourselves an OPerator.

    Thanks @Justin for mentioning it here in the comments! /OPER username password worked for me! thanks

  3. Avatar for Virgilio Rodriguez
    Virgilio Rodriguez on

    I was able to connect a Windows PC but I tried the same with a Mac, iPhone, Linux and I kept getting a load ident error and those clients could connect.

    I am trying to resolve this before Tuesday so I can use it as a project for a class. Please help.

  4. Avatar for Zsombor
    Zsombor on

    What command do I need to type in to op myself in the server?

    1. Avatar for Justin
      Justin on

      I got stuck here too, found this on GeekShed. Syntax: /OPER userid password

Leave a Reply

Your email address will not be published. Required fields are marked *