Self-Hosting Soju

Soju is an IRC bouncer that is easy to host and use. I was introduced to it from chat.sr.ht, Sourcehut’s hosted IRC bouncer available for paying customers.

Recently, Sourcehut had an outage. I didn’t mind this, it didn’t impact my workflow at the time, and it was also a fairly short outage that was addressed and resolved quickly, but it reminded me that other services do have down time from time to time, so I decided to start hosting Soju myself, on my own server.

The setup was refreshing from having worked with znc. Admittedly, I don’t remember any of the details, but I remember the setup being painful1.
Hosting my server with Alpine, the setup was easy. Since my server was still running on v3.15 and Soju is only available in the testing repository on edge, I first had to update to edge. This was very easy, only requiring an update of the version number (or in this case, setting it to edge) in /etc/apk/repositories, as well as a pair of apk update and apk upgrade --available.

Installing Soju, then, was extremely easy, only requiring the installation of the soju, soju-openrc, and, optionally for documentation only, the soju-doc packages.
The setup was a little bit harder, though. The reason was that by default Soju on Alpine looks for the sqlite database in /var/lib/soju/main.db2, something I was not aware of. Following the installation instructions that only mentioned using sojuctl create-user username -admin was a little misleading with this exact installation procedure, but I eventually figured out that calling this would create a soju.db in the current directory, which is not what I wanted.

After figuring this out (as well as setting up a subdomain and creating the necessary keys for TLS), everything worked flawlessly.
The user configuration (networks, etc.) works by messaging BouncerServ. Using network create with the appropriate parameters set up the networks, and joining channels worked properly. Use help to list all available commands and help <command> to get help for a specific command. Alternatively, the documentation for these commands are available in soju(1).

A small gotcha I had was that I was still logged in to all the networks on chat.sr.ht which forced my bouncers to use my nick with an _ added at the end. This was really a non-issue, though, and simply logging out from chat.sr.ht fixed this.

If you’re looking for an IRC bouncer to host, I can only recommend using Soju, it’s extremely simple to use.

Edit 2023-12-28: On startup, soju loads, among other things, the certificates in memory. These will, hopefully, get renewed for you, but soju won’t be aware of this.
Luckily, soju reloads the certificates when it receives a HUP signal. When I renew my certificates, I simply send it a HUP now to reload the certificates!

Thanks to Max for informing me of this!

Hosting other Sourcehut services

In the future I’m looking to self-host a bunch of Sourcehut services myself. I have tried this before but ultimately failed at setting up the mail server as I hadn’t researched enough for this yet.3 It’s very much out of my comfort zone, never having worked with mail servers before, and postfix simply looks scary to a newcomer, given the huge amount of configuration and things you can do wrong.
Configuring postfix would also give me the ability to possibly self-host email entirely, given that I figure out how to make big-tech accept my email, if possible.4

Being able to self-host Sourcehut and link to my personal instance for my projects would be nice, and I hope I can manage to find some time in the future to set this up myself. For now, though, I’m happy with Sourcehut and will continue to host my projects there for the foreseeable future; at least until I’m done with exams, my bachelor thesis, and other things coming up.


  1. Whether this was due to inexperience or a harder setup in general, I don’t remember ↩︎

  2. This is configurable via the configuration file, located in /etc/soju/config by default. More information can be found in soju(1)↩︎

  3. If you’re reading this and have experience in setting up an email server, or even setting up a Sourcehut instance, help would be highly appreciated! Just shoot me an email. ↩︎

  4. Even though I would love to self-host my email, not being able to communicate with what is probably most of the world because I’m getting blocked on the basis of nothing but “you are not a big, established company” is definitely a no-go. ↩︎

Do you have a comment on one of my posts? Feel free to send me an E-Mail: witcher@wiredspace.de
To participate in a public discussion, use my public inbox: ~witcher/public-inbox@lists.sr.ht
Please review the mail etiquette.

Posted on: January 17, 2023

Articles from blogs I read

Some OpenBSD features that aren't widely known

# Introduction In this blog post, you will learn about some OpenBSD features that can be useful, but not widespread. They often have a niche usage, but it's important to know they exist to prevent you from reinventing the wheel :) => https://www.o…

via Solene'% February 24, 2024

mwx(4), another new wi-fi driver, added to -current

Hot on the heels of qwx(4) [see earlier report], and soon after going -beta, -current has gained another new wi-fi driver - mwx(4). Claudio Jeker (claudio@) committed the import: CVSROOT: /cvs Module name: src Changes by: claudio@cvs.openbsd.org 2024/02/21 03:48:10 Mod…

via OpenBSD Journal February 23, 2024

Rust participates in Google Summer of Code 2024

We're writing this blog post to announce that the Rust Project will be participating in Google Summer of Code (GSoC) 2024. If you're not eligible or interested in participating in GSoC, then most of this post likely isn't relevant to you; if y…

via Rust Blog February 21, 2024

Generated by openring