
Step 1 — Installing Docker Engine
First, update your existing list of packages:
sudo apt update
Next, install a few prerequisite packages which let apt
use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Then add the GPG key for the official Docker repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
This will also update our package database with the Docker packages from the newly added repo.
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce
You’ll see output like this, although the version number for Docker may be different:Output of apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 5:19.03.9~3-0~ubuntu-focal
Version table:
5:19.03.9~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
Notice that docker-ce
is not installed, but the candidate for installation is from the Docker repository for Ubuntu 20.04 (focal
).
Finally, install Docker:
sudo apt install docker-ce
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
sudo systemctl status docker
https://docs.docker.com/engine/install/ubuntu/
Step 2 — Installing Docker Compose
To make sure you obtain the most updated stable version of Docker Compose, you’ll download this software from its official Github repository.
First, confirm the latest version available in their releases page. At the time of this writing, the most current stable version is 1.29.2
.
The following command will download the 1.29.2
release and save the executable file at /usr/local/bin/docker-compose
, which will make this software globally accessible as docker-compose
:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Next, set the correct permissions so that the docker-compose
command is executable:
sudo chmod +x /usr/local/bin/docker-compose
To verify that the installation was successful, you can run:
docker-compose --version
You’ll see output similar to this:
Outputdocker-compose version 1.29.2, build 5becea4c
Docker Compose is now successfully installed on your system. In the next section, you’ll see how to set up a docker-compose.yml
file and get a containerized environment up and running with this tool.
https://docs.docker.com/compose/install/
### NEW ###
apt update && apt upgrade -y
apt install curl -y
curl -sSL https://get.docker.com/ | sh
docker run –restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
sudo curl -L https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-
###uname -s
–uname -m
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
Recent Comments