To install Docker and Docker Compose on an Ubuntu machine, you can follow these steps
Update the System
Before installing Docker, it's a good idea to update your system’s package index:
sudo apt update
Install Required Dependencies
Docker needs a few dependencies like curl, apt-transport-https, and ca-certificates. Install these by running:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
Install Add Docker's Official GPG Key
To ensure that the installation is from Docker’s official repository, add the Docker GPG key: