This Bash server-setup.sh script automates the provisioning and management of a self-hosted server environment. It provides interactive prompts and executes the following tasks:
-
HTTP Port Enablement: Optionally opens port 80 via iptables.
-
Docker Installation: Optionally installs Docker Engine, CLI, and Docker Compose.
-
Selfhosted Applications Setup:
-
Ensures proper ownership and permissions for
/opt. -
Clones the
Selfhost-Applicationsrepository into/opt. -
Cleans up Git metadata, README, and unwanted files.
-
Recursively removes any
delete-this.txtfiles.
-
-
Interactive App Management: Prompts to keep or remove each application folder (e.g., Portainer, Watchtower, Immich, Nextcloud, etc.).
-
Bulk Service Startup: Optionally runs
docker-compose up -din each application directory containing adocker-compose.yml.
-
Interactive Prompts: Defaults to “Y” for most operations, allowing you to skip steps easily.
-
Idempotent Directory Handling: Won’t re-clone if the directory already exists.
-
Safe Cleanup: Confirms before removing application directories.
-
Bulk Orchestration: Starts all Docker Compose services in one go.
curl -L -o server-setup.sh https://raw.githubusercontent.com/Saisamarth21/Selfhost-Applications/refs/heads/main/server-setup.shchmod +x server-setup.sh./server-setup.sh-
Ubuntu or Debian-based Linux
-
bashshell -
sudoprivileges
The script manages the following apps:
-
Portainer
-
Watchtower
-
Immich
-
Nextcloud
-
File Browser
-
Glance Dashboard
-
JDownloader2
-
Jenkins
-
Nginx Proxy Manager
-
SonarQube
-
Rancher
-
TinyAuth
-
Dozzle
-
Cup
-
Jellyfin
-
Paperless-ngx
-
n8n
-
Visual Studio Code
-
Cup updates
-
Uptime kuma
-
Dockge
