Reading time: < 1 minutes
Today we’re going to see how to install Docker and Docker Compose on Oracle Linux.
The first thing we’re going to do is update the system:
sudo yum check-update
Then we add the Docker repository:
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Now we install Docker:
dnf install docker-ce -y
And it will start installing:
Once installed, we need to enable Docker to run on system restart:
sudo systemctl start docker sudo systemctl enable docker
And now we can run Docker:
docker run hello-world
Docker Compose is installed along with Docker, to run it we’ll use:
sudo docker compose version
If we need to run Docker without root:
We create the docker group:
sudo groupadd docker
We add the user to the docker group:
sudo usermod -aG docker $USER
We activate the group changes:
newgrp docker
Now we can run commands without sudo:
docker run hello-world
If we need to remove Docker or Docker Compose:
- First, stop Docker
systemctl stop docker
Remove Docker:
dnf remove docker-ce -y
And remove Docker Compose
rm -rf /usr/local/bin/docker-compose
1 thought on “Install Docker and Docker Compose on Oracle Linux”