Installing Dendrite on Elementary OS Latest

Step 1: Install necessary dependencies

Firstly, you need to install the required dependencies using the following command:

sudo apt install build-essential cmake git libprotobuf-dev protobuf-compiler libssl-dev sqlite3 libsqlite3-dev

Step 2: Clone the dendrite repository

Now, you need to clone the dendrite repository using git by running the following command:

git clone https://github.com/matrix-org/dendrite.git

Step 3: Build dendrite

Next, you need to navigate to the dendrite directory and run the build script with the following commands:

cd dendrite
./build.sh

Step 4: Create dendrite configuration file

Copy the /etc/dendrite directory from the dendrite repository to the system-wide config location:

sudo mkdir /etc/dendrite
sudo cp -r dendrite/etc/* /etc/dendrite/

Create a config file:

sudo nano /etc/dendrite/dendrite.yaml

and enter the following contents:

server:
  listen: "0.0.0.0:8008"
  use_unix_socket: false
  tls_cert_file: "/etc/dendrite/dendrite.tls.crt"
  tls_private_key_file: "/etc/dendrite/dendrite.tls.key"
  datastore:
    engine: sqlite3
    sqlite3:
      file: /var/lib/dendrite/dendrite.sqlite3

app_service_api:
  internal_api_url: "http://127.0.0.1:7778"

media_api:
  base_path: "/_matrix/media/r0"

federation_api:
  listen: "0.0.0.0:8448"
  tls_cert_file: "/etc/dendrite/federation.tls.crt"
  tls_private_key_file: "/etc/dendrite/federation.tls.key"

metrics:
  prometheus_listen: "0.0.0.0:8000"

registration:
  enabled: true

Step 5: Setup database and generate server key

Create the directory to store the dendrite sqlite database:

sudo mkdir -p /var/lib/dendrite
sudo chown -R $(whoami) /var/lib/dendrite
sqlite3 /var/lib/matrix/dendrite.sqlite3 '.databases'

You should see a blank response indicating the database exists.

Generate a fresh set of tls keys:

sudo mkdir /etc/dendrite/
cd /etc/dendrite/
openssl req -x509 -nodes -newkey rsa:4096 -keyout dendrite.tls.key -out dendrite.tls.crt -days 365 -subj /CN=$(hostname)
openssl req -x509 -nodes -newkey rsa:4096 -keyout federation.tls.key -out federation.tls.crt -days 365 -subj /CN=$(hostname)

Step 6: Start dendrite

To start dendrite, run the following command:

./dendrite-monolith-server

This will start dendrite and it will listen on port 8008 for client connections and 8448 for federation.

Congratulations! You have successfully installed and configured Dendrite on your Elementary OS Latest machine.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!