Deploy a Matrix server using Conduit and Cinny on FreeBSD in the homelab
Here is a small post about deploying a Matrix server in the homelab.
The goal is a Matrix server running on a FreeBSD jail that can be used from the web browser on your desktop.
It is a quick-and-dirty configuration, to get you started.
This setup is for testing purposes. The server will not be exposed to the internet and it will not federate with the Matrix network.
The setup contains three parts:
- the Conduit Matrix server
- the Cinny web Matrix client
- NGINX as reverse proxy
Domain names
First, create in your local DNS server two subdomain names, one for
Conduit and one for Cinny, f.e., matrix.example.com and
cinny.example.com, both pointing to the ip-address of the jail.
Certificates
Create certificates for the two domains.
If you haven't setup a local CA, do that first, for example using mkcert.
Place the certificate files in /etc/ssl/certs/ in the jail.
Conduit
Conduit advertises itself as a simple, fast and reliable matrix server.
It is available as a FreeBSD package.
Copy the file /usr/local/etc/conduit.toml.sample to /usr/local/etc/conduit.toml
and edit this file:
Servername
This is the subdomain of your Conduitserver.
servername = "matrix.example.com"
Registration token
New users can register with this token.
registration_token = "very-secret"
Allow federation
We won't expose our server to the internet. Federation will not be required and we will not allow it.
allow_federation = false
Cinny
Cinny is yet another Matrix client. It runs as a web application. You access it with your web browser.
It is available as a FreeBSD package.
The package manager installs Cinny in /usr/local/www/cinny.
In this directory, copy the file config.json.example to config.json and edit it:
homeserverList
Delete all entries in the homeserverList and insert the subdomain of your Conduit server.
"homeserverList": [
"matrix.example.com"
],
featuredCommunities
Probably you can delete a lot here. I only cleaned the list "servers":
"servers": ["matrix.example.com"]
NGINX
NGINX is a very great web server.
It is available as a FreeBSD package.
Here we use it as a reverse proxy.
In the file /usr/local/etc/nginx/nginx.conf add two blocks for the
virtual servers:
server {
listen *:443 ssl;
server_name matrix.example.com;
client_max_body_size 1G;
ssl_certificate /etc/ssl/certs/matrix.example.com.crt;
ssl_certificate_key /etc/ssl/certs/matrix.example.com.key;
location / {
proxy_pass http://127.0.0.1:6167;
}
}
server {
listen *:443 ssl;
server_name cinny.example.com;
client_max_body_size 1G;
ssl_certificate /etc/ssl/certs/cindy.example.com.crt;
ssl_certificate_key /etc/ssl/certs/cindy.example.com.key;
location / {
root /usr/local/www/cinny;
index index.html;
}
}
Allow the daemons to run
In /etc/rc.conf add two lines to allow the daemons to run.
conduit_enable="YES"
nginx_enable="YES"
Start or restart the Conduit and the NGINX daemons.
Create a few accounts
Open cinny.example.com in your web browser.
Register as new account. Choose your server (matrix.example.com), and provide a user name and a password. Insert the registration token from the Conduit configuration (above this is mentioned as "very-secret") in the field below the two password fields.
Repeat, to get a few accounts to play with.
Have fun playing with Matrix in you homelab!
Webrings
100% made with ♥ by a human — no cookies, no trackers.
Proud member of the 250kb.club,
the no-JS.club,
the Blogroll.Club,
and the Bukmark.Club.
Don’t let a billionaire’s algorithm control what you read — use an RSS feed reader.
Most recent pages All tags Sitemap RSS of Gophersite
