| README.md | ||
_ _ _ _
| |__ _____ _| |_ ___ ___(_)_ __ ___ _ __ | | _____ __
| '_ \ / _ \ \ /\ / / __/ _ \ / __| | '_ ` _ \| '_ \| |/ _ \ \/ /
| | | | (_) \ V V /| || (_) | \__ \ | | | | | | |_) | | __/> <
|_| |_|\___/ \_/\_/ \__\___/ |___/_|_| |_| |_| .__/|_|\___/_/\_\
|_|
General
In my setup, I got myself a virtual server on hetzner. But you can do the same on any debian based system.
You need to purchase a domain, I personally used netbeat.de.
Then point it to the ip of your server. Or configure a dyndns Service updating the ip of your server. Netbeat gives you that for free, with tutorial. But also others do, for instance no-ip, or you can also just write your domain provider to use the nameservers of your server provider ( for real via email )
FYI: Vautron gives you dyndns for free, and there is an NGO in Berlin that does that too.
But there are a lot of tutorials for that, and I personally pay for my dyndns Service.. so yeah.
Lets start with the actual setting up.
Install docker compose
There are several ways to install docker compose. I use the official repos, and I integrate them into the apt manager. So with an apt update && apt upgrade, also the docker compose binaries get upgraded to the newest ones.
Issue all the following commands:
apt-get update
apt-get install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
Then you can actually install
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Test if everything worked:
docker run hello-world
Installing simplex server ( SMP server )
I used the docker compose file from the link
https://simplex.chat/docs/server.html#docker-container
It was this one, at the time of my writing:
name: SimpleX Chat - smp-server
services:
oneshot:
image: ubuntu:latest
environment:
CADDYCONF: |
${CADDY_OPTS:-}
http://{$$ADDR} {
redir https://{$$ADDR}{uri} permanent
}
{$$ADDR}:8443 {
tls {
key_type rsa4096
}
}
command: sh -c 'if [ ! -f /etc/caddy/Caddyfile ]; then printf "$${CADDYCONF}" > /etc/caddy/Caddyfile; fi'
volumes:
- ./caddy_conf:/etc/caddy
caddy:
image: caddy:latest
depends_on:
oneshot:
condition: service_completed_successfully
cap_add:
- NET_ADMIN
environment:
ADDR: ${ADDR?"Please specify the domain."}
volumes:
- ./caddy_conf:/etc/caddy
- caddy_data:/data
- caddy_config:/config
ports:
- 80:80
restart: unless-stopped
healthcheck:
test: "test -d /data/caddy/certificates/${CERT_PATH:-acme-v02.api.letsencrypt.org-directory}/${ADDR} || exit 1"
interval: 1s
retries: 60
smp-server:
image: ${SIMPLEX_IMAGE:-simplexchat/smp-server:latest}
depends_on:
caddy:
condition: service_healthy
environment:
ADDR: ${ADDR?"Please specify the domain."}
PASS: ${PASS:-}
volumes:
- ./smp_configs:/etc/opt/simplex
- ./smp_state:/var/opt/simplex
- type: volume
source: caddy_data
target: /certificates
volume:
subpath: "caddy/certificates/${CERT_PATH:-acme-v02.api.letsencrypt.org-directory}/${ADDR}"
ports:
- 443:443
- 5223:5223
restart: unless-stopped
volumes:
caddy_data:
caddy_config:
Also create a .env file in the same directory as the docker-compose.yml file, with the following written in it:
ADDR=<the-domain-pointing-to-the-ip-of-your-instance>
That's it :)
Now, if the domain is pointing to your server, you can issue
docker compose up -d
in the directory of the yml file, and your server is up. You can go to your-domain.org and have a look at the stats of the simplex server running.
connecting your simplexchat App to your server
The first time is actually a bit tricky, even though I probably miss a bit of information. But in the end, this is how I did it:
After the creation of the docker-compose containers and networks, that are running now, you have new directories in the directory of the yml file.
Go to smp_configs, where you will find two important files for connecting.
The one is the fingerprint file, which gives you the fingerprint of your server. The second one is the smp-server.ini, which is like the configuration file.
In the smp-server.ini, choose a create_password variable
create_password: <your-long-password-with-numbers-letters-and-symbols>
Just above that, you have a description in the comments.
Now restart and rebuild the whole thing, after saving the ini file:
docker compose down
docker compose up -d
Done!
So what you have to type in into your "my servers" section in the simplexchat App, is
smp://fingerprint:password@host1,host2
host1 stands for your domain name, which is the one pointing to the server. password is the one you just specified.
After typing all the long character chains, you will have a QR Code in your App, which you can share without typing : )
Have fun!