Install a community server
Run your own Tusile community on your own machine. You need Docker and Docker Compose, nothing else: one script sets up the rest.
The bundle is a normal Compose stack of five containers: the community server, Postgres, Caddy for HTTPS, LiveKit for voice and video, and a small livekit-cert-sync sidecar that hands Caddy’s certificate to LiveKit.
Choose Cloud or Offgrid
Section titled “Choose Cloud or Offgrid”This is the only choice that changes what you need. Everything after it is the same either way, and the setup script asks you which one you want.
| Cloud | Offgrid | |
|---|---|---|
| Accounts | Tusile accounts | usernames and passwords that exist only on your server |
| Contacts tusile.com | yes | never, from either the server or the app |
| You need | a server token created in the app, and a public hostname | any address the app can reach, a LAN IP such as 192.168.1.50 included |
| Listed in the app’s server list | yes | no |
No hostname yet? Duck DNS, No-IP and FreeDNS all hand out a free subdomain you point at your server’s IP. Offgrid does not need one: the script sets up a local certificate for whatever address you give it, and the app asks you to confirm that certificate the first time you connect.
Self-hosting either way means your community’s messages live on hardware you control; see where Tusile stands on EU Chat Control.
Install it step by step
Section titled “Install it step by step”-
Unpack
community-server.zip. -
Run the setup script in the
community-serverfolder.Double-click
setup.bat.Terminal window chmod +x setup.sh./setup.sh -
At
Choice [1]:pick1for Cloud or2for Offgrid, then answer the prompts. Cloud asks for your server token, which you get by creating a server in the Tusile app.The script generates LiveKit keys, writes
.envand theCaddyfile, configures HTTPS and TURN/TLS, and starts the stack. -
Open the ports it prints (see Ports to open).
The script is safe to re-run. If the stack does not come up, it prints the failing container’s logs and you run it again. It does the same steps you would do by hand, and you are welcome to read it first.
First run takes a few minutes
Section titled “First run takes a few minutes”Text chat works as soon as setup finishes. Voice can lag around six minutes behind on a first run with a public domain: LiveKit will not start without its TURN certificate, Caddy has to obtain that from Let’s Encrypt first, and the livekit-cert-sync sidecar copies it across on a five-minute cycle. LiveKit restart-loops until then. That is expected, and it fixes itself.
docker compose logs -f livekitConnect from the app
Section titled “Connect from the app”Cloud: your server appears in the app’s server list. Sign in with your Tusile account and open it.
Offgrid: the server starts with no accounts at all, so setup prints a one-time owner claim token when it finishes:
OWNER CLAIM TOKEN 4f8c-2a91-ee03-7b1d-a52f-91c4-3e07-d6b8Valid 24h, single use.-
Turn the Offgrid toggle on, on the sign-in screen or at the top of the server rail.
-
Enter your server’s address and press Connect. Use the same address you gave the script: a certificate issued for
127.0.0.1is not valid forlocalhost, and the connection fails if the two disagree. -
Choose Create account, pick a username and password, and paste the claim token.
That first account becomes the owner and gets the Admin role. The token is then spent, and everyone else joins with an invite you create from the app. New Offgrid servers are invite-only by default; you can switch that to open or closed in Server settings.
Lost the claim token?
Section titled “Lost the claim token?”It stays on the data volume until it is used, so you can read it again at any time. No output means the server has already been claimed.
docker compose exec -T community-server cat /app/data/owner_claim_tokenIf it expired, or the server was claimed by the wrong account, clear the owner and restart. A fresh token is issued on the next boot. This needs shell access to the machine, which is the point.
docker compose exec postgres psql -U tusile_community -d tusile_community \ -c "UPDATE server_settings SET owner_user_id = NULL"docker compose restart community-serverCheck it works
Section titled “Check it works”docker compose ps # five containers, each up or healthycurl https://your-domain/health # {"status":"ok"}curl https://your-domain/info # Offgrid: "offgrid": true, plus claim_availableThen join from the Tusile app and try text and voice in one channel. If something is wrong, Troubleshooting lists the usual causes by symptom.
To prove an Offgrid server really is standalone, block outbound traffic to api.tusile.com and confirm nothing breaks. docker compose logs community-server | grep -i tusile.com should stay empty.
Ports to open
Section titled “Ports to open”The setup script prints this list when it finishes. Open these ports on your router or firewall and forward them to the machine. A LAN-only Offgrid server needs nothing forwarded.
| Port | Why |
|---|---|
80/tcp, 443/tcp |
Caddy: the community API, and the Let’s Encrypt challenge. Port 80 is not optional on Cloud. |
7880/tcp |
LiveKit WebSocket, through Caddy. |
7881/tcp |
LiveKit ICE/TCP fallback. |
50000-50060/udp |
RTP media. Required for voice and video. |
3478/udp |
TURN/UDP and STUN. Helps clients behind strict firewalls. |
5349/tcp |
TURN/TLS. Setup enables it and livekit-cert-sync feeds it the certificate, so just open the port. Without it, people on UDP-blocked or symmetric-NAT networks get one-way audio. |
Port 9090 is also published on the host for direct access to the community API. With Caddy in front, 80 and 443 are the main entry. The media range holds about one port per simultaneous voice user; to widen it, see LIVEKIT_RTP_PORT_START in the configuration reference.
No port forwarding? Use a tunnel
Section titled “No port forwarding? Use a tunnel”If you cannot forward ports (your ISP uses CGNAT, or the router is not yours), or you would rather members never see your home IP, put a small VPS in front. A WireGuard tunnel links the VPS to the machine running the stack, the VPS forwards the ports above through it, and your home network opens nothing. It works for Cloud and Offgrid alike.
-
Bring up WireGuard between the two machines. The examples below use
10.8.0.1for the VPS and10.8.0.2for your machine, on the tunnel. -
Point your hostname at the VPS public IP, and give setup that hostname.
-
On the VPS, allow the ports from the table above in its firewall and forward them into the tunnel (
eth0is the VPS’s public interface):Terminal window sysctl -w net.ipv4.ip_forward=1iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 80,443,7880,7881,5349 -j DNAT --to-destination 10.8.0.2iptables -t nat -A PREROUTING -i eth0 -p udp -m multiport --dports 3478,50000:50060 -j DNAT --to-destination 10.8.0.2Put these in the VPS’s WireGuard config as
PostUplines so they survive a reboot. -
Send the replies back the same way. The simplest route is
iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADEon the VPS, but then every member reaches your server from10.8.0.1and they all share its per-IP rate limits. That is fine for a group of friends. For a bigger community, skip the masquerade and setAllowedIPs = 0.0.0.0/0for the VPS peer on your machine instead, so its traffic leaves through the tunnel and members keep their own addresses. -
Tell LiveKit to advertise the VPS. It finds its public IP by asking from your machine, which returns your home address, not the VPS. In
livekit.prod.yamlsetnode_ip: <VPS public IP>anduse_external_ip: false, then rundocker compose restart livekit. If you skip this, text works and voice connects, but nobody hears anything.
Tunnel services that forward only HTTP(S) cannot carry the UDP media ports, so text chat works through them but voice does not.
Unattended install
Section titled “Unattended install”Every answer can also be given as a flag, so nothing prompts. This is the path for cloud-init, CI and fleets. Supply the mode, the hostname, and for Cloud the token; the “Press Enter to start” gate is then implied.
./setup.sh --offgrid --hostname chat.example.com --yes./setup.sh --cloud --token YOUR_TOKEN --hostname chat.example.com --yes./setup.sh --help.\setup.ps1 -Offgrid -HostName chat.example.com -Yes.\setup.ps1 -Cloud -Token YOUR_TOKEN -HostName chat.example.com -Yes.\setup.ps1 -Helpsetup.bat forwards whatever you pass it to setup.ps1, and skips its press-a-key pause when given arguments.
| Flag | What it does |
|---|---|
--offgrid / -Offgrid |
Standalone server with local accounts. |
--cloud / -Cloud |
Tusile accounts; needs a token. |
--token / -Token |
The server token from the app. Implies Cloud. |
--hostname / -HostName |
The domain (or, for Offgrid, a LAN IP) the server is reached on. |
--yes / -Yes |
Skip the “Press Enter to start” gate. |
--force / -Force |
Allow a Cloud install on a host Let’s Encrypt cannot issue a certificate for. Almost always a mistake. |
Check the exit code rather than parsing the output:
| Code | Meaning |
|---|---|
0 |
The stack is up and serving. |
1 |
Bad arguments, or a host a Cloud install cannot work on. |
2 |
The stack did not come up. The failing logs are printed, and re-running is safe. |
For a full cloud walkthrough (instance sizing, firewall rules, Docker via cloud-init, teardown), see Host on AWS EC2.
Install by hand
Section titled “Install by hand”The setup script only writes config files, so you can write them yourself.
-
Unpack the archive:
Terminal window unzip community-server.zipcd community-server -
Create your
.envfrom the template:Terminal window cp .env.example .envThe bundle deliberately ships no
.env: an existing one is how the setup script recognises a previous install, and a ready-made file made every fresh install look like an upgrade. -
Generate a LiveKit key pair and put it in
.envasLIVEKIT_API_KEYandLIVEKIT_API_SECRET:Terminal window docker run --rm livekit/livekit-server generate-keysThere is no default, and the stack will not start without them. Compose hands the pair to LiveKit as
LIVEKIT_KEYS, which replaces thekeys:block oflivekit.prod.yaml, so leave that block as it ships. -
Set the rest of
.env:COMMUNITY_PUBLIC_URL: your server’s public URL, such ashttps://chat.example.com. Required in both modes.- Cloud:
SERVER_TOKEN, the token from the app. - Offgrid:
OFFGRID_MODE=true, and leaveSERVER_TOKENempty.
Everything else has a working default. Every variable is in the configuration reference.
-
Edit the
Caddyfile: replacecommunity.example.comwith your domain in both site blocks. Caddy obtains TLS certificates automatically. -
Enable TURN/TLS (recommended): in
livekit.prod.yamluncommenttls_port,domain,cert_fileandkey_file, and setdomainto your hostname. Thelivekit-cert-synccontainer then supplies the certificate from Caddy, for the host ofCOMMUNITY_PUBLIC_URL(setTURN_DOMAINonly to override it). -
Enable voice presence events (recommended): in
livekit.prod.yamluncomment thewebhook:block and set itsapi_keyto yourLIVEKIT_API_KEY. That is how the server learns who joined or left a voice channel. -
Start the stack:
Terminal window docker compose up -d
Offgrid without a domain
Section titled “Offgrid without a domain”Let’s Encrypt will not issue for an IP address, so Caddy has to use its own certificate authority. Do not use a bare tls internal: the app pins the certificate fingerprint, and the default internal certificate lives only 12 hours, so the connection breaks after the first renewal. The exact stanzas, and why the web app cannot use a self-signed server at all, are in App says the certificate changed.
Each Caddy site block gets its own certificate, matched by name. A block for 127.0.0.1 will not answer for localhost: it aborts the handshake rather than presenting anything. Connect using exactly the address you configured, or list both names on the block.
Moving a Cloud server to Offgrid
Section titled “Moving a Cloud server to Offgrid”There is no migration. Offgrid is for new installs: existing members are identified by their Tusile account, and on an Offgrid server there is nothing local to map them onto.
To run Offgrid on the same machine anyway, start a fresh install next to the old one. Bring the old stack down first and move its .env aside:
cd community-serverdocker compose down # volumes are keptmv .env .env.cloud # keeps the old project name on record./setup.sh --offgrid --hostname chat.example.com --yesBoth steps matter. Setup keeps the Compose project name of an existing .env, so re-running it in place would point the Offgrid server at the Cloud database; with no .env it treats the run as a new install and picks a fresh name (community-offgrid-<hash>). And once the old .env is gone, Compose no longer knows that project, so a stack you did not bring down first keeps running and the new one cannot bind ports 80, 443 or 7880.
The Offgrid stack starts with an empty database. The old volumes stay on disk until you remove them with docker volume rm. To go back, bring the Offgrid stack down and restore .env.cloud as .env.
Keep your data safe
Section titled “Keep your data safe”The community-data volume holds community_key on an Offgrid server: the signing key the server’s identity is derived from. Losing it is far worse than losing a Cloud server’s install ID. Back it up together with the database and uploads, as described in Backup and restore.
Do not change COMPOSE_PROJECT_NAME on a running deployment. It prefixes every volume name, so changing it silently orphans your database and your uploads.
To move to a newer server version, see Upgrades.