Skip to main content
New to this? Read How Socketchat works first.

Where the server keeps its data

Everything sits in one data folder. --data-dir picks it; without it, the server uses a folder under your user’s home: The folder holds the database (server.db with its -wal and -shm files), the certificate (cert.der) and its private key (key.der), the config file socketchat-server.toml, and a files folder of encrypted file pieces. The server keeps the folder readable by its own account only.

Server commands

--host defaults to localhost, which only works on the same machine. --listen defaults to 0.0.0.0:7444, every IPv4 address on port 7444; use --listen [::]:7444 to listen on IPv6.

The config file

socketchat-server.toml in the data folder holds these settings. The server reads it at start, so restart it after an edit. Megabytes here are 1,000,000 bytes. At a storage limit the server refuses new messages or files with a reason the app shows, until members fetch older ones or they expire.

What the server cleans up

The server deletes a message once every member’s app has it, and a file once every member has saved it. When the last member leaves a room, the server deletes everything it holds for that room at once. Every hour it also deletes:
  • messages and files older than retention_days;
  • invite links past their expiry;
  • join requests nobody acted on within 7 days;
  • rooms with no members;
  • uploads that did not finish within 6 hours.

Back up

1

Stop the server

With systemd: sudo systemctl stop socketchat. Otherwise press Ctrl-C where it runs.
2

Copy the whole data folder somewhere safe

key.der is the certificate’s private key, so store the copy where only you can read it.
3

Start the server again

With systemd: sudo systemctl start socketchat.
Keep cert.der and key.der above all. Every invite link and every member’s app remembers this certificate’s fingerprint. If you lose them and set the server up again, each person’s app shows the old and new fingerprints and changes nothing until that person accepts the new certificate. Tell everyone to expect it. See A certificate-change warning. If you restore to a different folder, change data_dir in socketchat-server.toml to match.

Acceptable use

As the operator you answer for what happens on your server. init prints the project’s acceptable-use statement; read it before you invite people.