SSB (Scuttlebutt) is a peer-to-peer network without any centralized server. All the stuff you write is registered on your local client and synchronized with your friends (peers) when they are reachable. Pub servers are used for regrouping peers but their are totally optionals. Read the doc for more information on the operation of the network.

In this post, we will see how to deploy a public SSB server on Arch Linux.

Install the ssb-server package from AUR:

yay -S ssb-server

Create a new system account for ssb:

sudo useradd -r -d /var/lib/ssb -m -U -s /bin/nologin ssb

Create the configuration file (replace ssb.slaanesh.org by your own public IP or hostname):

sudo -u ssb mkdir -p /var/lib/ssb/.ssb/ && sudo -u ssb cat > /var/lib/ssb/.ssb/ <<EOF
{
  "connections": {
    "incoming": {
      "net": [
        { "scope": "public", "host": "0.0.0.0", "external": "ssb.slaanesh.org", "transform": "shs", "port": 8008 }
      ]
    },
    "outgoing": {
      "net": [{ "transform": "shs" }]
    }
  }
}
EOF

Create a systemd service and start-it:

sudo cat > /etc/systemd/system/ssb-server.service <<EOF
[Unit]
Description=SSB server
After=network.target

[Service]
Type=simple
User=ssb
ExecStart=/usr/bin/ssb-server start

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable --now ssb-server

Check if the server is working

$ sudo -u ssb ssb-server whoami
{
  "id": "@xk4cd6wxK63gUApR8efzzLKZMiy4pt7sfiVcXO85EZw=.ed25519"
}

Customize the server public profile (replaces @xk4c….ed25519 by what you get from the previous command:

sudo -u ssb ssb-server publish --type about --about "@xk4cd6wxK63gUApR8efzzLKZMiy4pt7sfiVcXO85EZw=.ed25519" --name "ssb.slaanesh.org" --description 'Pub server operated by [killruana](@bdU1NEdwitxME6Cjl8X8hvxUDDu8HSYCkRF3zJg1zgw=.ed25519)'

The description parameter support Markdown formatting and is optional.

Create an invitation link for allowing others to join your server:

$ sudo -u ssb ssb-server invite.create 1
"ssb.slaanesh.org:8008:@xk4cd6wxK63gUApR8efzzLKZMiy4pt7sfiVcXO85EZw=.ed25519~GgNRQCc2BkZLUdr0TOHQpQuq4TsxELzM4Cdc2C8bj0Y="

Tadam!

Profile of my own public SSB server