How to Set Up Prosody for You and Your Friends

From Nick Faro's Homepage
Revision as of 01:29, 17 March 2021 by Nick (talk | contribs) (Created page with "[ Signal seems to have gone closed-source.] I like Signal a lot but there are so...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Signal seems to have gone closed-source. I like Signal a lot but there are some legitimate criticisms of it-- I never really minded that it's centralized and not federated, but I really don't want to be using a platform that is (currently) lying to its users and claiming to be free and open-source when it's not. I'm no free software maniac, but it just doesn't feel right. Even though it's end-to-end encrypted, so theoretically a compromised server wouldn't reveal my conversations, I started looking for a different solution.

I've heard a lot about federated, self-hostable protocols like XMPP and Matrix, so I decided to explore if it's feasible to switch my small non-programmer friend group over to a self-hosted XMPP server running on a Raspberry Pi in my house.

The two most popular XMPP servers out there are ejabberd and Prosody. I went with Prosody since I found that it's easier to configure (all the settings are basically perfect out of box) and it's less resource hungry, especially nice for running on a Pi. For the following instructions, I'm going to assume you're using a Debian-based OS since that's what I used.

Step 1: Get a Domain Name

Yeah, if you're self-hosting then you pretty much need to set up a domain name for your server. Sucks, but thems the breaks. I bought a .xyz domain for $1 and pointed it at a No-IP domain, then set up my router to do DDNS with No-IP.

Step 2: Install Prosody

Add Prosody's repository in order to get the latest version.

echo deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list

Then install Prosody.

sudo apt-get install prosody

Step 3: Add a VirtualHost for your domain

Open up /etc/prosody/prosody.cfg.lua and scroll down to the very bottom. Add a line like this:

VirtualHost "<your domain>"

Step 4: Enable multi-user-chat

If you want to be able to create group chats, add these lines below your VirtualHost line. "MUC" means Multi-User Chat in XMPP parlance and just means group chats.

Component "conference.<your domain>" "muc"
modules_enabled = {

We now have a usable XMPP server, but it's not complete yet-- we need to enable some plugins which enable some useful features that most people will want.

Step 5: Get the Prosody community modules