For self-hosters

Set up your own snug server

Prepare a Linux host, install snug, and test calls from outside your network.

Run snug on a Linux machine you control. A $99 lifetime license includes every update. A server you run has no seat limit. A domain is optional. To have snug run the machine instead, see Start a snug server.

One machine runs all of snug for your group: the app your friends open, the database, the uploads, and the calls. Install the released server package; a source checkout is for development.

What you're responsible for

  • The host: its logins, SSH keys, and operating system updates.
  • Backups: snug backs up on the host every night. Getting a copy off the host is yours.
  • Updates: snug updates itself in a window an admin picks, unless you pin it.
  • The address: the domain and its DNS record if you use one, and every firewall and router in front of the machine.
  • Uptime: when the machine is off, so is the server.
  • Help: your members come to you and your admins. snug hosting support covers only servers snug runs.

Before you invite anyone, read who can see what, then set a text filter and test the report process.

Get a server license

Get a server license before you install. One license runs one snug server at a time. The host, and a domain if you want one, cost extra. The refund policy gives a full refund within 30 days of buying.

Find the license in the email as snug-license.lic or as text starting with SNUG1.. Keep both private. Anyone with the license can move it to another server. The previous server stops admitting members at its next license check.

The server activates its license online during install, then checks it once a day. If the server can't reach snug.chat, it keeps letting members in until the Validation required by date that ./snug/snug-ops license status shows.

Check the host

You need:

  • Ubuntu 24.04 LTS, Ubuntu 26.04 LTS, Debian 12 (Bookworm), or Debian 13 (Trixie) on amd64 or arm64
  • Linux kernel 6.1 or newer
  • Docker Engine 28.5.2 or newer
  • Docker Compose 2.24.4 or newer
  • 1 logical CPU, 2 GiB of memory, and 20 GiB of free disk
  • a public IPv4 address that reaches the machine
  • a domain that points at that address, if the group wants a name

Docker can wait. The prepare step below installs it.

A VPS usually has a public IP address. At home, forward the required ports from your router to your host. Read if you host at home before buying anything. Carrier-grade NAT blocks inbound traffic. A private network needs an HTTPS certificate browsers already trust.

Use one server login

Use a non-root login for the snug folder and every snug-ops command, such as the one your provider gave you. Its name doesn't have to be snug.

If your provider gives you only root, create a user with sudo access and copy your SSH key to it first. DigitalOcean has a step-by-step Ubuntu guide. Test the new login in a second terminal before you close the root session. Root still works, but doctor warns, because one mistyped command can change the whole host.

Keep using the login that installs snug. It owns the snug folder and the update schedule. snug-ops refuses commands from any other account, root and sudo included, and prints the exact command to run instead.

Install the host command

From the folder where snug/ should live, run:

curl -fsSL https://snug.chat/install.sh | sh

The bootstrap downloads the released server package, checks its size and checksum, and unpacks it into snug/. It doesn't install system packages, add accounts, change groups, or start anything. Success prints Installed snug with the version and folder.

Check what the host still needs. This changes nothing:

./snug/snug-ops doctor

Each line starts with [ok], [warn], or [fix]. Only a [fix] line blocks the install. A ready host ends with This host is ready for snug.

Prepare the host

Run:

./snug/snug-ops prepare

prepare runs the same checks and prints every command it wants to run. It waits for you to type yes, then runs them with sudo. It changes only what failed a check:

  • installs cron and util-linux, which run automatic updates
  • removes Ubuntu's or Debian's own Docker packages, which conflict with Docker's
  • installs Docker Engine and Compose from Docker's own repository, after checking Docker's signing key against a fingerprint snug pins, or starts Docker if it's stopped
  • gives your login access to Docker
  • turns off Docker's userland proxy, which would start a helper process for every call port
  • raises the kernel's limit on how much call traffic can wait while the server is busy
  • opens the web and call ports in UFW, when UFW is active

It doesn't touch provider firewalls, cloud security groups, routers, or DNS. On a host that needs nothing, it prints Nothing to change on this host.

Turning off the userland proxy or upgrading Docker restarts Docker, which stops every container on the host. prepare names the containers that won't come back on their own and starts them again afterwards. snug-ops gets your new Docker access at once. A plain docker command gets it at your next sign-in.

If prepare stops

If a command fails, prepare stops and names the command. Fix the error and rerun prepare. It skips completed steps.

It refuses before changing anything when:

  • Docker isn't the host's own service (DOCKER_HOST, another context, or rootless mode)
  • Docker's signing key doesn't match the pin
  • your login can't use sudo, or sudo needs a password and there's no terminal to ask on
  • it can't list the containers a Docker restart would stop

Each refusal prints what to do next. If your login can't read /etc/docker/daemon.json, prepare leaves that file alone and prints the change to make as root. snug/current/RUNBOOK.md lists every step and refusal.

Open the ports outside the host

prepare ends by asking snug.chat to try the ports from the internet: TCP 80 and 443 for the app, and both ends and the middle of UDP and TCP 40000-40400 for calls. Nothing has to be listening yet. snug.chat learns your server's address and the port numbers, and nothing else.

Reachable ports show [ok]. An unreachable TCP port shows [fix] and where to check. UDP ports that don't answer show [warn]. Check your firewalls, then make a call from outside the network to confirm.

Open the required ports in the provider's firewall or security group, and forward them on your router if you host at home. Check again:

./snug/snug-ops ports

Leave TCP 80 open for good. It redirects visitors to HTTPS, and snug renews its certificate over it.

Scroll sideways or use the arrow keys to read the full diagram.
Web and call traffic must both cross every provider firewall, router, and host firewall before they reach the snug server.

Settle the address

Pick the one address members will open. snug gets an HTTPS certificate for it.

If you have a domain

Point an A record at the server's public IPv4 address. A name is easier to paste into a message, and it survives moving snug to another machine.

If you don't have a domain

Use the server's public IPv4 address. There's nothing to buy and no DNS record to make. Let's Encrypt issues certificates for IP addresses, so browsers allow microphones, cameras, and screen sharing as they would for a name. Those certificates last about six days and renew themselves. A server that spends a week off the internet comes back untrusted until it renews.

Moving to a domain later is one command, move the server to a new address, and everyone signs in at the new address once.

If you host at home

A home connection can host a snug server when it has a public IPv4 address, even one that changes now and then. Cable and fiber lines usually do.

  1. Forward TCP 80 and 443 and UDP and TCP 40000-40400 on the router to the machine.
  2. Use a domain, because each friend's sign-in works only at the address they joined at.
  3. Keep the domain pointed at your address with the router's dynamic DNS or a small updater.

When your address changes, calls keep announcing the old one. Tell snug the new one:

./snug/snug-ops address --ip 203.0.113.9

That restarts the server once, which disconnects everyone in a call.

Carrier-grade NAT can't take inbound traffic, so no forwarding helps. If the router's internet address starts with 100.64 through 100.127, that's what you have. Most 5G home internet and Starlink's standard plan work this way. Ask the provider for a public address, or host on a small VPS instead.

A home line limits screen sharing. Chat and voice need little, but a 1080p60 share reaches each viewer at several megabits, and a residential uplink runs out long before a VPS does.

Install snug

If you plan more than one snug server on this machine, read run several servers on one machine first. Otherwise, run:

./snug/snug-ops install

It checks the host again and stops on any [fix] line. Then it asks three things in order:

  1. The license: paste the certificate from your license email, one long line starting with SNUG1., or press Enter to add it later.
  2. The public IPv4 address for calls. snug fills in the machine's own public address, or the one snug.chat sees it at.
  3. The address members open. Press Enter to use the IP address.

To use the .lic file instead, copy it onto the server and pass its path. Flags for the other answers skip those questions:

./snug/snug-ops install \
  --domain chat.example.com \
  --ip 203.0.113.10 \
  --license ~/snug-license.lic

install saves the configuration and prints an admin setup code. It then activates the license, starts snug, schedules updates and nightly backups, and asks snug.chat to try the ports again. Success prints snug is ready at https:// and your address. If a port is still closed, it says snug is running but the internet can't reach it yet, and names the port.

Without a license, install finishes setup and leaves the server locked. When you have the license, run the same command and paste it when prompted.

If a domain doesn't point at the address you gave, install prints a Note: and carries on. Fix the record before you invite anyone.

install prints the admin setup code once. Keep it until you've created the first admin account, when the code stops working. If you lose it before anyone joins, recover admin access.

Keep your own copy of the license somewhere other than this host. Backups leave the license out. If you copied the .lic file over, delete it once activation succeeds:

rm ~/snug-license.lic

If activation fails, install finishes setup and the server retries automatically. The server opens when activation succeeds. Check progress with ./snug/snug-ops license status.

Prove the server works

Open the address over HTTPS and enter the admin setup code. Then test the server as a member:

  1. Run ./snug/snug-ops status and check that it reads Healthy.
  2. Join from the public HTTPS address.
  3. Send a message, reload, and check that it's still there.
  4. Upload a small file and download it again.
  5. Make a voice call with someone outside the host's network.
  6. Open connection info for yourself and for the other person. Both paths should show UDP. TCP means that path fell back from UDP, so check the call ports. A dash means no recent measurement.
  7. Play one supported media link and change the media bot's volume.
  8. Run ./snug/snug-ops backup and copy the backup it prints off the host.

Then read maintain your own snug server before the server holds anything the group would miss.