Skip to content

Instantly share code, notes, and snippets.

@dzungvu
Created March 14, 2026 14:50
Show Gist options
  • Select an option

  • Save dzungvu/e95a79d69472cc59e42a8b0fd0285092 to your computer and use it in GitHub Desktop.

Select an option

Save dzungvu/e95a79d69472cc59e42a8b0fd0285092 to your computer and use it in GitHub Desktop.
Install docker compose on linux
# Update your package index and install necessary prerequisite packages:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
# Add Docker's official GPG key and set up the repository:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /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
# Update the package index again to include the new Docker repository, and then install the docker-compose-plugin:
sudo apt-get update
sudo apt-get install docker-compose-plugin
# Verify the installation by checking the version:
docker compose version
# (Optional) Manage Docker as a non-root user: To run Docker commands without sudo, add your user to the docker group:
sudo usermod -aG docker $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment