✳️ Replace the highlighted information with your own
📌 Docker
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt install ca-certificates curl vim gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
📌 Portainer
version: '3.8' # Specify the version of the Docker Compose file format.
services: # Define the list of services (containers) to be managed.
portainer: # Name of the service.
image: portainer/portainer-ce:latest # Use the latest image of Portainer Community Edition.
container_name: portainer # Set a custom container name.
restart: always # Always restart the container if it stops or the system reboots.
ports:
- "9443:9443" # Expose HTTPS port for secure access.
- "9000:9000" # Expose HTTP port for web UI access.
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Allow Portainer to manage Docker via the host socket.
- portainer_data:/data # Store persistent Portainer data in a named volume.
volumes:
portainer_data: # Declare the named volume for Portainer's persistent data.