Standalone Binary
The standalone binary includes embedded NATS and optional automatic TLS. It does not use an external database.
You can use the automatic TLS function in Chatto. You can also put Chatto behind your reverse proxy.
Architecture
Section titled “Architecture”By default, chatto run starts an embedded NATS server with JetStream. Chatto
reads chatto.toml from the current working directory. It stores embedded NATS
data in ./data/ by default.
Prerequisites
Section titled “Prerequisites”Prepare these items:
- A Linux, macOS, or FreeBSD host with Chatto installed.
- A domain that points to the host, such as
chat.example.com. - Persistent storage for the Chatto data directory.
- Inbound TCP ports 80 and 443 when Chatto terminates TLS.
Install Chatto with Homebrew on macOS or Linux:
brew install chattocorp/tap/chattoYou can also download an archive from GitHub Releases.
Configure Chatto
Section titled “Configure Chatto”Use the Quick Start guide to generate
chatto.toml.
Before you use the configuration in production, do these steps:
- Set
webserver.urlto the public URL. - Add at least one verified email address to
owners.emails. - Configure SMTP (the default transport) or JMAP if Chatto must send registration or verification email.
- Select automatic Chatto TLS or TLS in a reverse proxy.
- Put
nats.embedded.data_diron persistent storage. - Set
nats.embedded.sync_intervaltoalwaysfor the strongest protection against data loss when the host stops without a normal shutdown. - Select the permitted login methods.
- Do a test of an external login provider before you set
auth.direct_logintofalse.
Examine these optional sections for the specified features:
- Use
[core.assets.s3]for S3-compatible upload storage. - Use
[push]for push notifications. - Use
[video]and[asset_processing]for video uploads. - Use
[livekit]for calls.
For a single embedded NATS server, use this setting:
[nats.embedded]sync_interval = 'always'This setting syncs each JetStream write to disk before NATS acknowledges it. It reduces write throughput. If you omit it, Chatto keeps the NATS default sync interval.
Run Chatto as a systemd Service
Section titled “Run Chatto as a systemd Service”On Linux, use systemd to start Chatto and restart it after a failure. Create this unit:
[Unit]Description=ChattoAfter=network-online.targetWants=network-online.target
[Service]Type=simpleUser=chattoGroup=chattoWorkingDirectory=/opt/chattoExecStart=/opt/chatto/chatto run -c chatto.tomlRestart=alwaysRestartSec=5AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]WantedBy=multi-user.targetMake sure that the chatto user can read chatto.toml and write the data
directory. Then, enable and start the service:
sudo systemctl enable --now chattoAdd Calls
Section titled “Add Calls”The standalone binary does not include LiveKit. Select one of these methods to add calls:
- Use Docker Compose with the included LiveKit service.
- Run a separate LiveKit server. Then, configure the LiveKit environment variables.