Introduction WeIRCd is a lightweight, fast, and highly customizable Internet Relay Chat (IRC) daemon written in Python. It is an excellent choice for developers, privacy enthusiasts, and small communities who want to host their own private chat networks without the bloat of traditional IRC servers. This guide will walk you through the step-by-step process of installing and configuring WeIRCd on a Linux-based system. Prerequisites
Before starting the installation, ensure your system meets the following requirements:
A Linux server (Ubuntu, Debian, or CentOS) with root or sudo access. Python 3.8 or higher installed on the system. Basic knowledge of the Linux command line.
Open ports (typically 6667 for standard IRC and 6697 for SSL/TLS) on your firewall. Step 1: Update Your System and Install Dependencies
First, log in to your server and update your local package index to ensure all your system repositories are up to date. sudo apt update && sudo apt upgrade -y Use code with caution.
Next, install Python, the pip package manager, and git, which you will need to clone the source repository. sudo apt install python3 python3-pip git -y Use code with caution. Step 2: Clone the WeIRCd Repository
Navigate to the directory where you want to host the application (such as /opt or your user home directory) and clone the official repository from GitHub. cd /opt sudo git clone https://github.com weircd Use code with caution.
Change ownership of the directory to your current user to avoid running the IRC daemon as root, which is a security risk. sudo chown -R \(USER:\)USER /opt/weircd cd /opt/weircd Use code with caution. Step 3: Install Required Python Packages
WeIRCd relies on a few external Python libraries to manage network connections and configurations. It is highly recommended to install these dependencies within a virtual environment to avoid conflicts with system-level packages. Create and activate a virtual environment: python3 -m venv venv source venv/bin/activate Use code with caution. Install the requirements listed in the repository: pip install -r requirements.txt Use code with caution. Step 4: Configure WeIRCd
WeIRCd relies on a central configuration file to define its behavior, network ports, and operator credentials. The repository includes a sample configuration file to get you started. Copy the example configuration file: cp config.example.json config.json Use code with caution.
Open the config.json file using your preferred text editor (such as nano): nano config.json Use code with caution.
Within this file, you should customize the following essential parameters:
Server Name: Change this to your domain or server identifier (e.g., ://yourdomain.com).
Network Name: The name of your chat network (e.g., MyLocalNet).
Bind Addresses and Ports: Set the IP address to 0.0.0.0 to listen on all interfaces, and verify the port is set to 6667.
O-Lines (Operators): Define administrative usernames and passwords so you can manage the server directly from an IRC client.
Save and close the file when you are finished updating your settings. Step 5: Configure the Firewall
To allow external users to connect to your chat server, you must open the designated IRC ports on your system’s firewall. If you are using Uncomplicated Firewall (UFW), run the following commands: sudo ufw allow 6667/tcp sudo ufw reload Use code with caution. Step 6: Start and Test Your IRC Server
With everything configured, you can launch the server using your virtual environment’s Python interpreter. python main.py Use code with caution.
Check the terminal output to ensure there are no error messages and that the server successfully binds to port 6667.
To test your new server, open any standard IRC client (such as HexChat, AdiIRC, or Irssi) on your local computer and connect using your server’s IP address: /server your_server_ip 6667 Use code with caution. Step 7: Run WeIRCd as a Background Service (Optional)
Running the application manually in your terminal means it will close as soon as you disconnect from your SSH session. To keep the server running permanently, create a systemd service file. Create a new service configuration file: sudo nano /etc/systemd/system/weircd.service Use code with caution.
Paste the following configuration into the file, adjusting the paths and user to match your system setup:
[Unit] Description=WeIRCd IRC Daemon After=network.target [Service] Type=simple User=your_username WorkingDirectory=/opt/weircd ExecStart=/opt/weircd/venv/bin/python /opt/weircd/main.py Restart=on-failure [Install] WantedBy=multi-user.target Use code with caution.
Reload systemd to recognize the new service, enable it to start on boot, and start the daemon immediately:
sudo systemctl daemon-reload sudo systemctl enable weircd sudo systemctl start weircd Use code with caution.
You can verify that the service is running smoothly by checking its status: sudo systemctl status weircd Use code with caution. Conclusion
You have successfully installed and deployed your own WeIRCd server. Your private, lightweight communication network is now fully operational. For advanced configurations, such as linking multiple servers together or setting up SSL/TLS encryption for secure messaging, refer to the advanced documentation folder located within your cloned WeIRCd directory. If you want to customize this guide further, let me know: What operating system version you are targeting?
If you need instructions for SSL/TLS certificate installation (Let’s Encrypt)? If you plan to link this server to other IRC servers?
I can update the technical steps to match your specific deployment plan.
Leave a Reply