How to Install Dendrite on Debian Latest
Dendrite is a Matrix server implementation that is written in Go. It provides a fast, reliable, and highly-scalable platform for Matrix communication. This tutorial will help you install Dendrite on Debian Latest.
Requirements
- A server running Debian Latest
- A non-root user with sudo privileges
- Basic knowledge of Linux command-line
Installation
- Update your Debian system:
sudo apt-get update && sudo apt-get upgrade
- Install the required packages:
sudo apt-get install -y curl wget git tar gcc rpm gdb make libxml2-dev libpq-dev libsqlite3-dev libssl-dev postgresql postgresql-contrib
- Install Golang:
wget https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
- Set up your Go environment:
echo 'export PATH=$PATH:/usr/local/go/bin' > ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc
- Clone the Dendrite git repository:
git clone https://github.com/matrix-org/dendrite.git
- Build Dendrite:
cd dendrite
make build
- Set up the Database:
sudo nano /etc/postgresql/12/main/pg_hba.conf
Add the following line:
host dendrite_db dendrite 127.0.0.1/32 md5
Save and exit the file.
Then, restart the PostgreSQL service:
sudo service postgresql restart
Create a database user:
sudo -u postgres createuser -P dendrite
Create a database:
sudo -u postgres createdb -O dendrite dendrite_db
- Configure Dendrite:
cp dendrite.yaml.example dendrite.yaml
nano dendrite.yaml
Fill in the following details:
postgres:
connstring: postgres://dendrite:password@localhost/dendrite_db?sslmode=disable
lazyloadmembers: true
keyserver:
signing:
enabled: false
enabled: true
mediaapi:
upload:
local:
directory: "/tmp/media"
url: "http://matrix.example.com/_matrix/media"
appserviceapi:
app_service_directory_server:
http:
address: matrix.example.com:8000
- Start Dendrite:
./bin/dendrite-monolith-server
Congratulations! You have successfully installed Dendrite on Debian Latest!