Uninstall
uninstall.sh is the companion to install.sh — it tears a node down cleanly, primarily so you
can re-test the one-liner installer as many times as you like.
curl -fsSL https://www.streamhub.studio/uninstall.sh | sudo bash # interactive, asks to confirmcurl -fsSL https://www.streamhub.studio/uninstall.sh | sudo bash -s -- --yes # non-interactivecurl -fsSL https://www.streamhub.studio/uninstall.sh | sudo bash -s -- --yes --purgeIt’s idempotent — safe to run even when nothing (or only part) of StreamHub is installed.
| Flag | Meaning |
|---|---|
--dir <path> |
Install directory to remove (default /opt/streamhub). |
--keep-data |
Keep <dir>/data (recordings/HLS/DB) — remove only the code. |
--purge |
Also prune Docker images + build cache (a truly fresh rebuild next time), and remove the nginx server block + the sysctl WebRTC drop-in. |
--purge-tls |
Also certbot delete the domain’s TLS certificate. Only pass this if you actually want it gone — a re-issue counts against Let’s Encrypt’s rate limits (~5 certs/week/domain). |
--domain <fqdn> |
Domain to use for the nginx site / cert removal (otherwise read from .env). |
--yes / -y |
Don’t prompt — required for non-interactive runs (no TTY). |
--help |
Show usage. |
What it removes vs. keeps
Section titled “What it removes vs. keeps”Removed by default:
- The Docker stack: containers + named volumes (
docker compose down -v --remove-orphans), plus any lingeringstreamhub-named containers. - The install directory (default
/opt/streamhub), including its data, unless you pass--keep-data. - Installer leftovers:
/var/log/streamhub-install.log,/var/log/streamhub-regen.log,/root/sh-run.sh,/root/regen.sh.
Kept by default:
- Docker itself.
- nginx and its server block.
- Any
ufwrules. - The Let’s Encrypt certificate. This is deliberate — Let’s Encrypt rate-limits issuance to roughly 5 certs/week/domain, so keeping the cert lets your next install reuse it instead of re-issuing.
--purge additionally prunes Docker build cache and dangling images
(docker builder prune -af, docker image prune -af), removes the nginx server block, and
removes the sysctl WebRTC drop-in (/etc/sysctl.d/99-streamhub-webrtc.conf).
--purge-tls additionally runs certbot delete --cert-name <domain>.
Reinstalling afterward
Section titled “Reinstalling afterward”Because --yes (without --purge/--purge-tls) keeps Docker, nginx, ufw, and the TLS
certificate, running the installer again is a clean rebuild that reuses the existing cert:
curl -fsSL https://www.streamhub.studio/install.sh | sudo bash