RSS Amplifier

cleberg.net · Dec 29, 2024

Self-Hosting Guide: The Lounge (IRC)

0
Sign in to vote or save

Christian Cleberg <hello@cleberg.net> · cleberg.net

· How to self-host The Lounge IRC client with Docker Compose.

1. The Lounge

The Lounge is a self-hosted IRC client for the web, which supports a lot of desirable features for a modern IRC client. The Lounge supports push notifications, link previews, file uploads, always connected, multi-user support, and is available as a PWA for mobile devices.

I wanted to write this as I had written a post about self-hosting Convos and have recently migrated over to The Lounge instead.

If you'd like to try a demo first, head over to the official demo website.

1.1. Installation (Docker)

I install everything I can via Docker, so this tutorial will install The Lounge with the Docker Compose platform.

You can find the official docker version of The Lounge's repository on GitHub at thelounge-docker.

To start, let's create a directory for this app and create the compose.yml file.

mkdir thelounge
cd thelounge
nano compose.yml

Within this configuration file, you can paste the content below and customize as needed. If you want to use a different port on your machine, change the first port on the 9000:9000 line. Additionally, you may move the volume to a different location if required.

services:
  thelounge:
    image: ghcr.io/thelounge/thelounge:latest
    container_name: thelounge
    ports:
      - "9000:9000"
    restart: always
    volumes:
      - ./.thelounge:/var/opt/thelounge

Save and close the file and you can now launch the service.

sudo docker compose up -d

The service is now available at localhost:9000 or machine_ip:9000 if you're browsing from a different device. Don't forget to allow the port through your machine's firewall, if you have one enabled.

The Lounge login page with username and password fields.
Figure 1: Login

1.2. Nginx Reverse Proxy

If you want to access the service via a domain name (thelounge.example.com), you can use Nginx as a reverse proxy.

First, create the Nginx configuration file.

sudo nano /etc/nginx/conf.d/

The configuration below assumes you have a wildcard certificate for HTTPS (:443) traffic via example.com. If you don't, you'll need to obtain an SSL certificate to use HTTPS.

upstream irc_upstream { server 127.0.0.1:9000; }
# HTTP redirect
server {
	listen      80;
	listen      [::]:80;
	server_name thelounge.example.com;
	include     custom.d/letsencrypt.conf;
	if ($host ~ ^[^.]+\.example\.com) {
		return 301 https://$host$request_uri;
	}
}
# HTTPS
server {
	listen                  443 ssl;
	listen                  [::]:443 ssl;
	http2			on;
	server_name             thelounge.example.com;
	# SSL
	ssl_certificate         /etc/letsencrypt/live/example.com/fullchain.pem;
	ssl_certificate_key     /etc/letsencrypt/live/example.com/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
	# reverse proxy
	location / {
	        proxy_pass           http://irc_upstream;
	        client_max_body_size 0;
	        proxy_set_header     X-Request-Base "$scheme://$host/";
		# Standard reverse proxy settings
		proxy_set_header Host $host;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection upgrade;
		proxy_set_header Accept-Encoding gzip;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-Host $http_host;
		proxy_set_header X-Forwarded-Uri $request_uri;
		proxy_set_header X-Forwarded-Ssl on;
		proxy_redirect  http://  $scheme://;
		proxy_http_version 1.1;
		proxy_set_header Connection "";
		proxy_cache_bypass $cookie_session;
		proxy_no_cache $cookie_session;
		proxy_buffers 64 256k;
	}
}

Finally, restart Nginx to see the effects.

sudo systemctl restart nginx.service

1.3. Initial Setup

The first thing you'll need to do is create a user. You can do this with the docker container with the following command, which will ask for a password.

sudo docker exec --user node -it thelounge thelounge add [username]

Once the user has been created, you'll be able to log in to the web interface. Once created, you can change your password in the settings panel of the web interface.

Finally, you can connect to an IRC server with the plus (+) button at the bottom of the sidebar and connect to individual channels or users via the plus (+) button next to your server's name in the sidebar.

Settings for network, proxy, preferences, and authentication.
Figure 2: New Server Connection
Libera.Chat server connection log and status.
Figure 3: Existing Server Connection
View of the #emacs channel on Libera.Chat.
Figure 4: Channel View

...or, comment on this post on Bubbles!

Read the original on cleberg.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.