Self-hosted chat

A self-hosted chat server that cannot read your messages.

Socketchat is one small program that runs both the chat app and the server. Run the server on a cloud server, a computer at home or a Raspberry Pi. Every room is end-to-end encrypted, so the server stores and forwards data it cannot read.

How do I set up a self-hosted chat server?

Install Socketchat on the machine, run socketchat server init with the name people will dial, then socketchat server run. Open port 7444 so friends can reach it.

On the server
socketchat server init --host chat.example.com
socketchat server run

Running init writes a config file and makes a TLS certificate. Invite links carry that certificate's fingerprint, so each app checks it reached your server. Host a server, in the docs, compares every way to run one, and Cloud server shows how to keep it running as a service.

Is there a self-hosted messaging app with end-to-end encryption?

Socketchat is one. The same program is the chat app and the server, and every room is end-to-end encrypted, so whoever runs the server cannot read what is said.

As a self-hosted chat app it covers group rooms, direct messages, invite links with a QR code, and encrypted files, photos and videos. For self-hosted instant messaging between a few friends or a small team, one server is enough.

What does a self-hosted encrypted chat server see?

The server can never read your messages, but it can see room rosters, when a message is sent, and can read IP addresses of users. It cannot see what was written or sent. It keeps all messages private, but does not make you anonymous.

Messages and files nobody has fetched are deleted after 30 days by default. The server keeps its database, certificate and files in one folder.

WHOWHENIP ADDRESSROOM

Can I host it without opening a port to the internet?

Yes. Put the server and your friends on a private network, such as Tailscale or WireGuard, and port 7444 never opens to the internet.

A private network links a few computers over the internet so they reach each other as if they shared one Wi-Fi network. Tailscale or WireGuard? compares the two.

Can I run a chat server on a Raspberry Pi?

Yes. Socketchat's server runs on a Raspberry Pi 4 or Zero 2 W with 64-bit Raspberry Pi OS, using the same one-line install.

The program has its encryption and database built in, so the Pi needs no Docker and no separate database server.

How does Socketchat compare with a self-hosted Matrix server?

Matrix links many providers so their users can talk to each other, and Socketchat serves one group on one server. Matrix says that whatever your provider is, you can talk to people using other providers, and that experts can set up their own.

Matrix lists several homeserver programs, including Synapse, which it describes as written in Python. Its guide recommends the Element app to beginners.

Socketchat's server is one program with its data in one folder, and its app is the same program. One app can join rooms on several servers, and /servers lists them.

What if I am used to hosting an IRC server?

Socketchat will feel familiar: you run one program, open one port and chat from a terminal. Every Socketchat room is also end-to-end encrypted, so the server never holds a message it can read.

The chat screen works at 80 by 24 and over SSH.

More questions

How do I host my own chat server?

Install Socketchat, run socketchat server init --host with your server's name or IP address, then socketchat server run, and open port 7444. Make your first invite with socketchat server invite.

Which port do friends need open?

Port 7444. Open it on the firewall or router in front of the machine that runs the server.

What does the server store?

Encrypted messages and files waiting for members, each room's roster, and the signed changes to it. It holds no key that can decrypt messages or files.

Install Socketchat

macOS or Linux, in a terminal
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/sachio222/socketchat_v4/releases/latest/download/socketchat-installer.sh | sh
Windows, in PowerShell
powershell -ExecutionPolicy Bypass -c "irm https://github.com/sachio222/socketchat_v4/releases/latest/download/socketchat-installer.ps1 | iex"
Or with Homebrew, on macOS or Linux
brew install sachio222/tap/socketchat

Open a new terminal when it finishes.

Then start a server with socketchat server init --host chat.example.com and socketchat server run, and open port 7444. Quick start on the home page.