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 (Archive)
Please review the mail etiquette.

Posted on: January 17, 2023

Articles from blogs I read

I managed to stop biting my nails

watch out!Some sections of this article make nail biting sound appealing. If you're currently avoiding biting your own nails, please be careful reading in case they make you want to bite. Remove sentences from the article?For a long time, I haven'…

via Cadence's Weblog December 12, 2024

I'm daily driving Jujutsu, and maybe you should too

I’m not the first to write about how Jujutsu won me over. I’ve seen it off and on, and each time it came across my feed it was bumped a bit higher in my “list of things to look at eventually”. It finally reached the top spot, I think, when I saw Tony Finn’s …

via Drew DeVault's blog December 10, 2024

Launching the 2024 State of Rust Survey

It’s time for the 2024 State of Rust Survey! Since 2016, the Rust Project has collected valuable information and feedback from the Rust programming language community through our annual State of Rust Survey. This tool allows us to more deeply understand ho…

via Rust Blog December 5, 2024

Generated by openring