I really didn’t think that it will ever be a necessary to use IRC in modern world. First of all, there are better alternatives like Discord and Matrix. Secondly, IRC is a technology from 1988. For a bit of context, in 1988 Soviet Union was still a thing, and Guns and Roses just started making good music.

Privileged Gen-Z rhetoric aside, it’s actually not all that bad. Yes, if you are old school you can still use IRC in the terminal, and constantly remind everyone how old days were much better than now, but that’s not very productive.

In this article I will take a look at a modern IRC client - The Lounge. It will be deployed as a Docker container and linked to a domain name.

What is need for this installation:

  • Domain name, in this case a working website running on Nginx
  • VPS with a public IP address
  • Docker and Docker Compose installed

Step 1: Install The Lounge

Installation is very simple and straightforward, as it is with almost all containerized software. Navigate to any directory, and create a docker-compose.yaml with following content:

version: '2'
services:
  thelounge:
    image: thelounge/thelounge:latest
    container_name: lng
    ports:
      - "9000:9000"
    restart: always
    volumes:
      - ~/.thelounge:/var/opt/thelounge

Couple things to note:

  • The Lounge will be available on port 9000, so it should be allowed in firewall
  • All chats will be saved in ~/.thelounge

run Compose in the same directory to launch the container:

docker compose up -d

To check if The Lounge is available, try to open the web UI in the browser via http://<server-ip>:9000

Step 2: Add users

The Lounge by default is in Private mode, and only allows created users to authenticate via SASL. To create a user (will be prompted for password):

docker exec --user node -it lng thelounge add <user>
docker exec --user node -it lng thelounge list

The second command will list existing users, and it can be used to verify that a new user was really created.

At this point it’s possible to authenticate in the web UI, but please remember that when accessing site using http, all the information entered there is unencrypted, so after https is implemented the password should be changed. It can easily be done in the console:

docker exec --user node -it lng thelounge reset <user>

Step 3: Connecting to domain

I went through the process of creating a website with TLS in the previous blog post.

If there is a working website with TLS configured, we can set up a reverse proxy to forward all traffic on port 9000 to the container. To do this, add to Nginx server configuration:

    location ^~ /lng/ {
        proxy_pass http://127.0.0.1:9000/;
        proxy_http_version 1.1;
        proxy_set_header Connection "upgrade";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;

        # by default nginx times out connections in one minute
        proxy_read_timeout 1d;
    }

Then open ~/.thelounge/config.js with any text editor, and change the reverseProxy parameter to true, and reload both Nginx and TheLounge:

nginx -t
systemctl reload nginx
docker restart lng

And that’s it! IRC client should be available on https://<domain>/lng