Get uncensored cypherpunk news: Session, SimpleX, Spasm

home / blog

Run your own Session server

Session currently supports private groups limited to 100 members and unlimited communities, which have to be self-hosted.

You can follow the official setup guide and get extra tips from this forum post. However, both sources lack a few necessary details, so let's do another deep dive.

Distros

There is no docker option out of the box, so you'll have to use a supported OS. The official guide mentions Ubuntu 20 and newer and Debian and newer, but it doesn't work on Ubuntu 24 and there is a dependency conflic on Debian 13. Thus, you're pretty much limited to Ubuntu 22 and Debian 12.

Supported OS: Ubuntu 22, Debian 12.

Private key

None of the guides provide an easy way to generate, back up, and restore your private key. However, it's very important to back up your private key, so you can restore all your communities (rooms) on another server.

Unfortunately, you cannot simply copy your private key using visual tools like cat, vim, or nano, so you have to copy the whole entropy file located at:

/var/lib/session-open-group-server/key_x25519

Alternatively, you can generate your own entropy and save it as a HEX string, which is easy to back up, and then derive your Session private key from it.

# generate entropy with openssl (zero dependencies, present on most distros)
openssl rand -hex 32 > key_x25519.hex

# (optional) improve entropy with your input by changing a few chars
vim key_x25519.hex

# display hex string (make sure to back it up)
cat key_x25519.hex

# convert hex file into raw 32-byte binary using xxd
xxd -r -p key_x25519.hex > key_x25519

# move generated private key into SOGS folder
mv key_x25519 /var/lib/session-open-group-server/key_x25519

Another option is to generate a 64-char long HEX string in your password manager and use it to derive a Session private key for a server.

# copy 64-char HEX string (password) into file
vim key_x25519.hex

# convert hex file into raw 32-byte binary using xxd
xxd -r -p key_x25519.hex > key_x25519

# move generated private key into SOGS folder
mv key_x25519 /var/lib/session-open-group-server/key_x25519

And if you need to restore your SOGS on a new server, then use your saved HEX string with the same commands.

Caddy

The official guide suggests installing sogs-standalone, but that option is good only if you dedicate a full server to running SOGS.

If you run other apps on the same server, then you should install sogs-proxied and configure routing yourself. This community guide recommends using Nginx, but Caddy is much simpler, modern solution since you don't have to mess with certificates.

The downside of using Caddy is that since SOGS only works with outdated distros, you'll have to use a third party repo to get Caddy.

Install Caddy

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl &&\
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg &&\
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list &&\
sudo apt update && sudo apt install caddy

Edit Caddy config

sudo vim /etc/caddy/Caddyfile

Change example.com to your domain name.

http://sogs.example.com {
    redir https://sogs.example.com{uri} permanent
}

sogs.example.com {
    reverse_proxy 127.3.2.1:4242
}

Reload and enable Caddy

sudo caddy reload --config /etc/caddy/Caddyfile
sudo systemctl enable --now caddy
sudo systemctl restart sogs.service

Database

# back up db (execute on a server)
mkdir ~/backups
sudo cp /var/lib/session-open-group-server/sogs.db "$HOME/backups/sogs$(date +%Y%m%d).db"

# download db from a server (execute on a home computer)
# change 'user' and 'server' accordingly
scp user@server:"/home/user/backups/sogs$(date +%Y%m%d).db" .

Other

# Create a new room
sudo sogs --add-room cypherpunks --name "Cypherpunks" --description "Get uncensored cypherpunk news without statist propaganda."

# Make a room read-only (like a channel)
sudo sogs --remove-perms w --rooms='cypherpunks'

# Check rooms
sudo sogs -L -v

# Add a write permission to a user
sudo sogs --rooms cypherpunks --add-perms w --users USER_SESSION_ID

# Remove a write permission
sudo sogs --rooms cypherpunks --add-perms w --users USER_SESSION_ID

# Add an admin
sudo sogs --rooms + --add-moderators USER_SESSION_ID --admin --visible

# Delete a room
sudo sogs --delete-room books

# Restart SOGS to apply changes
sudo systemctl restart sogs.service

# Convert regular Session ID to blinded ID
read -r -p "Session ID (non-blinded one starting 05): " id && cd /var/lib/session-open-group-server && sudo su -s /usr/bin/python3 -c 'import sogs.crypto; abs_id = sogs.crypto.compute_blinded_abs_id("'$id'"); neg_abs_id = sogs.crypto.blinded_neg(abs_id); print(neg_abs_id)'; cd -

Cypherpunks:

We run the largest privacy news channel on Session, which you can join to get uncensored cypherpunk news without statist propaganda.

  • Option 1: scan this QR code

  • Option 2: copy-paste the channel link into "join community" in your app

Useful: