Commit 4892725b authored by Administrator's avatar Administrator

Update install.sh

parent 6e216834
...@@ -4,10 +4,19 @@ ...@@ -4,10 +4,19 @@
apt update apt update
# Install necessary prerequisites # Install necessary prerequisites
apt install -y apt-transport-https ca-certificates curl software-properties-common apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg-agent
# Install Docker using the official installation script # Add Docker’s official GPG key
curl -fsSL https://get.docker.com | sh curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker APT repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package index again
apt update
# Install Docker version 24.0.2
apt install -y docker-ce=5:24.0.2-1~ubuntu.20.04~focal docker-ce-cli=5:24.0.2-1~ubuntu.20.04~focal containerd.io
# Start and enable Docker # Start and enable Docker
systemctl start docker systemctl start docker
...@@ -24,16 +33,16 @@ fi ...@@ -24,16 +33,16 @@ fi
# Add the current user to the Docker group # Add the current user to the Docker group
usermod -aG docker $USER usermod -aG docker $USER
# Install Portainer # Install Portainer 1.20.2
docker volume create portainer_data docker volume create portainer_data
docker run -d -p 80:9000 --name=portainer --restart=always \ docker run -d -p 80:9000 --name=portainer --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data portainer/portainer-ce -v portainer_data:/data portainer/portainer
# Verify Portainer installation # Verify Portainer installation
docker ps -a docker ps -a
echo "Docker and Portainer have been installed successfully. Portainer is running on port 80." echo "Docker 24.0.2 and Portainer 1.20.2 have been installed successfully. Portainer is running on port 80."
# End of script # End of script
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment