An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor(install-scripts): update Docker installation process to include manual installation fallback and improve error handling
Andras Bacsai746a801de7af
diff --git a/other/nightly/install.sh b/other/nightly/install.shindex f0fcdfb4e3..f0bcc082b2 100755--- a/other/nightly/install.sh+++ b/other/nightly/install.sh@@ -20,7 +20,7 @@ DATE=$(date +"%Y%m%d-%H%M%S")OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')ENV_FILE="/data/coolify/source/.env"-VERSION="20"+VERSION="21"DOCKER_VERSION="27.0"# TODO: Ask for a userCURRENT_USER=$USER@@ -438,7 +438,7 @@ fiif [ -x "$(command -v snap)" ]; thenSNAP_DOCKER_INSTALLED=$(snap list docker >/dev/null 2>&1 && echo "true" || echo "false")if [ "$SNAP_DOCKER_INSTALLED" = "true" ]; then- echo " - Docker is installed via snap."+ echo "Docker is installed via snap."echo " Please note that Coolify does not support Docker installed via snap."echo " Please remove Docker with snap (snap remove docker) and reexecute this script."exit 1@@ -446,16 +446,46 @@ if [ -x "$(command -v snap)" ]; thenfiinstall_docker() {+ set +ecurl -s https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh 2>&1 || trueif ! [ -x "$(command -v docker)" ]; thencurl -s https://get.docker.com | sh -s -- --version ${DOCKER_VERSION} 2>&1if ! [ -x "$(command -v docker)" ]; then- echo " - Docker installation failed."- echo " Maybe your OS is not supported?"- echo " - Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue."- exit 1+ echo "Automated Docker installation failed. Trying manual installation."+ install_docker_manuallyfifi+ set -e+}++install_docker_manually() {+ case "$OS_TYPE" in+ "ubuntu" | "debian" | "raspbian")+ apt-get update+ apt-get install -y ca-certificates curl+ install -m 0755 -d /etc/apt/keyrings+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc+ chmod a+r /etc/apt/keyrings/docker.asc++ # Add the repository to Apt sources+ echo \+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \+ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" |+ tee /etc/apt/sources.list.d/docker.list+ apt-get update+ apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin+ ;;+ *)+ exit 1+ ;;+ esac+ if ! [ -x "$(command -v docker)" ]; then+ echo "Docker installation failed."+ echo " Please visit https://docs.docker.com/engine/install/ubuntu/ and install Docker manually to continue."+ exit 1+ else+ echo "Docker installed successfully."+ fi}echo -e "3. Check Docker Installation. "if ! [ -x "$(command -v docker)" ]; then@@ -522,34 +552,18 @@ if ! [ -x "$(command -v docker)" ]; thensystemctl enable docker >/dev/null 2>&1;;"ubuntu" | "debian" | "raspbian")- if [ "$OS_TYPE" = "ubuntu" ] && [ "$OS_VERSION" = "24.10" ]; then- echo " - Installing Docker for Ubuntu 24.10..."- apt-get update >/dev/null- apt-get install -y ca-certificates curl >/dev/null- install -m 0755 -d /etc/apt/keyrings- curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc- chmod a+r /etc/apt/keyrings/docker.asc-- # Add the repository to Apt sources- echo \- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \- $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" |- tee /etc/apt/sources.list.d/docker.list >/dev/null- apt-get update >/dev/null- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin >/dev/null-- if ! [ -x "$(command -v docker)" ]; then- echo " - Docker installation failed."- echo " Please visit https://docs.docker.com/engine/install/ubuntu/ and install Docker manually to continue."- exit 1- fi- echo " - Docker installed successfully for Ubuntu 24.10."- else- install_docker+ install_docker+ if ! [ -x "$(command -v docker)" ]; then+ echo " - Automated Docker installation failed. Trying manual installation."+ install_docker_manuallyfi;;*)install_docker+ if ! [ -x "$(command -v docker)" ]; then+ echo " - Automated Docker installation failed. Trying manual installation."+ install_docker_manually+ fi;;esacecho " - Docker installed successfully."diff --git a/scripts/install.sh b/scripts/install.shindex bc3b5b084d..bd3a7ce9e9 100755--- a/scripts/install.sh+++ b/scripts/install.sh@@ -20,7 +20,7 @@ DATE=$(date +"%Y%m%d-%H%M%S")OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')ENV_FILE="/data/coolify/source/.env"-VERSION="20"+VERSION="21"DOCKER_VERSION="27.0"# TODO: Ask for a userCURRENT_USER=$USER@@ -438,7 +438,7 @@ fiif [ -x "$(command -v snap)" ]; thenSNAP_DOCKER_INSTALLED=$(snap list docker >/dev/null 2>&1 && echo "true" || echo "false")if [ "$SNAP_DOCKER_INSTALLED" = "true" ]; then- echo " - Docker is installed via snap."+ echo "Docker is installed via snap."echo " Please note that Coolify does not support Docker installed via snap."echo " Please remove Docker with snap (snap remove docker) and reexecute this script."exit 1@@ -446,16 +446,46 @@ if [ -x "$(command -v snap)" ]; thenfiinstall_docker() {+ set +ecurl -s https://releases.rancher.com/install-docker/${DOCKER_VERSION}.sh | sh 2>&1 || trueif ! [ -x "$(command -v docker)" ]; thencurl -s https://get.docker.com | sh -s -- --version ${DOCKER_VERSION} 2>&1if ! [ -x "$(command -v docker)" ]; then- echo " - Docker installation failed."- echo " Maybe your OS is not supported?"- echo " - Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue."- exit 1+ echo "Automated Docker installation failed. Trying manual installation."+ install_docker_manuallyfifi+ set -e+}++install_docker_manually() {+ case "$OS_TYPE" in+ "ubuntu" | "debian" | "raspbian")+ apt-get update+ apt-get install -y ca-certificates curl+ install -m 0755 -d /etc/apt/keyrings+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc+ chmod a+r /etc/apt/keyrings/docker.asc++ # Add the repository to Apt sources+ echo \+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \+ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" |+ tee /etc/apt/sources.list.d/docker.list+ apt-get update+ apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin+ ;;+ *)+ exit 1+ ;;+ esac+ if ! [ -x "$(command -v docker)" ]; then+ echo "Docker installation failed."+ echo " Please visit https://docs.docker.com/engine/install/ubuntu/ and install Docker manually to continue."+ exit 1+ else+ echo "Docker installed successfully."+ fi}echo -e "3. Check Docker Installation. "if ! [ -x "$(command -v docker)" ]; then@@ -522,34 +552,18 @@ if ! [ -x "$(command -v docker)" ]; thensystemctl enable docker >/dev/null 2>&1;;"ubuntu" | "debian" | "raspbian")- if [ "$OS_TYPE" = "ubuntu" ] && [ "$OS_VERSION" = "24.10" ]; then- echo " - Installing Docker for Ubuntu 24.10..."- apt-get update >/dev/null- apt-get install -y ca-certificates curl >/dev/null- install -m 0755 -d /etc/apt/keyrings- curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc- chmod a+r /etc/apt/keyrings/docker.asc-- # Add the repository to Apt sources- echo \- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \- $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" |- tee /etc/apt/sources.list.d/docker.list >/dev/null- apt-get update >/dev/null- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin >/dev/null-- if ! [ -x "$(command -v docker)" ]; then- echo " - Docker installation failed."- echo " Please visit https://docs.docker.com/engine/install/ubuntu/ and install Docker manually to continue."- exit 1- fi- echo " - Docker installed successfully for Ubuntu 24.10."- else- install_docker+ install_docker+ if ! [ -x "$(command -v docker)" ]; then+ echo " - Automated Docker installation failed. Trying manual installation."+ install_docker_manuallyfi;;*)install_docker+ if ! [ -x "$(command -v docker)" ]; then+ echo " - Automated Docker installation failed. Trying manual installation."+ install_docker_manually+ fi;;esacecho " - Docker installed successfully."