From 40a19cf8d63e52b3a13957bbf59efe803609a01f Mon Sep 17 00:00:00 2001 From: monoadmin Date: Sat, 7 Feb 2026 00:55:33 -0800 Subject: [PATCH] First Commit --- install_convoy.sh | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 install_convoy.sh diff --git a/install_convoy.sh b/install_convoy.sh new file mode 100644 index 0000000..9cc9f55 --- /dev/null +++ b/install_convoy.sh @@ -0,0 +1,112 @@ +#!/bin/bash +set -e + +### BASIC CHECKS ### +if [ "$EUID" -ne 0 ]; then + echo "❌ Please run this script as root" + exit 1 +fi + +echo "🔍 Detecting Linux distribution..." + +if [ -f /etc/os-release ]; then + . /etc/os-release +else + echo "❌ Cannot detect Linux distribution" + exit 1 +fi + +OS_ID="$ID" +OS_VERSION="$VERSION_ID" + +echo "đŸ–Ĩī¸ Detected: $PRETTY_NAME" + +### DETERMINE PACKAGE MANAGER ### +case "$OS_ID" in + ubuntu|debian) + PM="apt" + ;; + almalinux|rocky|centos|rhel) + PM="dnf" + ;; + *) + echo "❌ Unsupported OS: $OS_ID" + exit 1 + ;; +esac + +### INSTALL DEPENDENCIES ### +echo "đŸ“Ļ Installing base dependencies..." + +if [ "$PM" = "apt" ]; then + apt update + apt install -y \ + ca-certificates \ + curl \ + gnupg \ + lsb-release \ + git +elif [ "$PM" = "dnf" ]; then + dnf install -y \ + ca-certificates \ + curl \ + gnupg2 \ + git +fi + +### INSTALL DOCKER ### +if ! command -v docker >/dev/null 2>&1; then + echo "đŸŗ Installing Docker..." + + curl -fsSL https://get.docker.com | sh +else + echo "✅ Docker already installed" +fi + +systemctl enable docker +systemctl start docker + +### INSTALL DOCKER COMPOSE (PLUGIN) ### +if ! docker compose version >/dev/null 2>&1; then + echo "🔧 Installing Docker Compose plugin..." + + mkdir -p /usr/local/lib/docker/cli-plugins + + curl -SL https://github.com/docker/compose/releases/download/v2.25.0/docker-compose-linux-x86_64 \ + -o /usr/local/lib/docker/cli-plugins/docker-compose + + chmod +x /usr/local/lib/docker/cli-plugins/docker-compose +else + echo "✅ Docker Compose already installed" +fi + +### INSTALL CONVOY ### +echo "🚀 Installing Convoy Panel..." + +INSTALL_DIR="/opt/convoy" + +if [ -d "$INSTALL_DIR" ]; then + echo "❌ $INSTALL_DIR already exists" + exit 1 +fi + +git clone https://github.com/convoypanel/convoy.git "$INSTALL_DIR" +cd "$INSTALL_DIR" + +### ENV SETUP ### +if [ ! -f .env ]; then + cp .env.example .env + echo "📝 Created .env file" +fi + +### START SERVICES ### +echo "âš™ī¸ Starting Convoy..." +docker compose up -d + +### DONE ### +echo +echo "✅ Convoy Panel installation complete!" +echo "🌐 Access it via: http://YOUR_SERVER_IP" +echo +echo "â„šī¸ Edit configuration: $INSTALL_DIR/.env" +echo "🔁 Restart: docker compose restart"