How to Setup an UnrealIRCd Server on Debian 9

From steamWiki
Jump to: navigation, search

UnrealIRCd is the most popular IRC server software on the planet with 43% market share (at the time of this writing).

This article will show you how to setup a basic IRC server on Debian 9. I say basic because I'm omitting (or removing) a number of the advanced features such as networking multiple servers and banning IP addresses.

Setup the Environment

  1. login as a user capable of running sudo
  2. run sudo apt update and sudo apt upgrade to bring your system up-to-date
  3. run sudo adduser ircd to create the UnrealIRCd's user
  4. run sudo adduser ircd sudo to add the ircd user to the sudo group (we'll remove this privilege at the end)
  5. run su ircd to switch to the ircd for most of the remainder of the install
  6. run sudo apt install wget make gcc build-essential openssl libcurl4-openssl-dev zlib1g zlib1g-dev zlibc libgcrypt20 libgcrypt20-dev libssl-dev to install necessary dependencies

Install UnrealIRCd

  1. run cd ~ to move to the home directory (where we'll install this software)
  2. run wget --no-check-certificate --trust-server-names https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz to download the latest installer package
  3. run tar xzvf unrealircd-*.tar.gz to uncompress the downloaded package
  4. run cd unrealirc-4.2.3 (replace 4.2.3 with the version you download)
  5. run ./Config
    1. press [Enter] throughout the entire Config process to accept their defaults until you get to the question "Do you want to generate an SSL certificate for the IRCd? Only answer No if you already have one."
      • press [Enter] to generate an SSL key if you're going to setup a local server that isn't visible to the wider internet. Then fill out the questions on What/Where for the SSL certificate (these values don't have to be anything specific).
      • If you are going to make this server available to the wider internet you'll want an official SSL certificate that people trust. In this case type No. For the trusted certificate you should use something like LetsEncypt. Right now I don't have instructions on that part but hopefully I'll get this updated soon.
  6. once the Config process is complete and you're back at the command prompt run make
  7. run make install
  8. run cd ..
  9. run rm unrealircd-*.tar.gz to remove the compressed package you downloaded
  10. run sudo rm -r unrealircd-* to remove the uncompressed package you downloaded

Configure UnrealIRCd

  1. run cp ~/unrealircd/conf/examples/example.conf ~/unrealircd/conf/unrealircd.conf
  2. run /home/ircd/unrealircd/unrealircd gencloak and copy the resultant 3 lines for use later
  3. run nano ~/unrealircd/conf/unrealircd.conf to edit the default config file
    1. comment out include "badwords.conf";
    2. uncomment include "spamfilter.conf";
    3. find the "me {" block
      1. change name to "myserver.com"
      2. change info to "My Server!"
    4. find the "admin {" block
      1. change the 3 lines to match your
        1. name
        2. username
        3. email address
    5. find the first "allow {" block
      1. add a line password "MyPassword";
      2. change maxperip to 100;
    6. find the second "allow {" block and delete it or comment it out
    7. find the "oper bobsmith {" block
      1. change "bobsmith" to your username
      2. change the password to your password
    8. find the "lin hub.mynet.org" block and delete it or comment it out
    9. find the "link services.mynet.org" and delete it or comment it out
    10. find the "ulines {" block and delete it or comment it out
    11. find the "drpass {" block and optionally change the passwords
    12. find the "ban ip {" block and delete or comment it out
    13. find the "ban server {" block and delete it or comment it out
    14. find the "ban user {" block and delete it or comment it out
    15. find the "ban realname {" blocks and delete them or comment them out
    16. find the "except ban {" block and enter your own ip or server address
    17. find the "except tkl {" block and enter your own ip or server address
    18. find the "deny dcc {" block and delete it or comment it out
    19. find the "deny channel {" block and delete it or comment it out
    20. find the "vhost {" block and delete it or comment it out
    21. find the "blacklist dronebl {" block and delete it or comment it out
    22. find the "blackist efnetrbl {" block and delete it or comment it out
    23. find the "/* Network configuration */ set {" block
      1. change network-name "MyIRCNet"
      2. change default-server "myserver.net"
      3. change services-server "myserver.net"
      4. change stats-server "myserver.net"
      5. in the "cloak-keys {" block change the 3 lines to the 3 lines your copied from the unrealircd gencloak command above
    24. find the "/* Server specific configuration */ set {" block
      1. change kline-address to your admin email
    25. hit Ctrl-X and then Y to save and quit nano
  4. create a Message Of The Day
    1. run touch ircd.motd
    2. run chmod 600 ircd.motd
    3. run nano ircd.motd and enter a suitable motd like "Welcome to my IRC server!"
  5. create, and enable, an IRCd service
    1. run nano /home/ircd/unrealircd/ircd.service and fill the file with the following
      • [Unit]
      • Description=UnrealIRCd IRC Daemon Service
      • After=network.target
      • [Service]
      • User=ircd
      • Group=ircd
      • Type=forki##*ng
      • ExecStart=/home/ircd/unrealircd/unrealircd start
      • ExecStop=/home/ircd/unrealircd/unrealircd stop
      • ExecReload=/home/ircd/unrealircd/unrealircd restart
      • [Install]
      • WantedBy=multi-user.target
    2. run ln -s /home/ircd/unrealircd/ircd.service /etc/systemd/system/ircd.service
    3. run sudo systemctl enable ircd to have UnrealIRCd start on boot
    4. run sudo systemctl start ircd to enable UnrealIRCd
    5. run exit to return to your original sudo user
    6. run sudo gpasswd -d ircd sudo to remove the ircd user from the sudo group

Now you can go connect to your irc server with something like HexChat.