Installing Docker on Oracle Linux

Hi everyone,

in today’s article I’ll walk you through how I installed Docker on an Oracle Linux machine. I needed to do the following to set up a basic local server with some devops / utility tools (e.g. Homer dashboard to centralize some links to company tools, SonarQube, GitLab runner, etc.).

The machine I followed this procedure on was a Red Hat Linux virtual machine on Oracle Cloud. Let’s now see what I did and why.

Step 1: getting to know the machine

Before installing anything, let’s see what we’re dealing with. The hostnamectl command gives us all the information we need:

The machine is an Oracle Linux Server 9.6 running as a VM (KVM on QEMU) with arm64 architecture. The important detail is another one: Oracle Linux is a RHEL-compatible distribution (you can also tell from the CPE cpe:/o:oracle:linux:9:6:server), with Oracle’s UEK (Unbreakable Enterprise Kernel). This means that, even though Oracle Linux is not among the platforms officially supported by Docker, we can follow the official guide for RHEL.

One more very important thing: the hostname “endor” is no coincidence, it’s exactly the planet of the Wookiees!

Why is Podman there and not Docker?

Searching for docker in the default repositories you only find Podman. The reason is a Red Hat choice: starting from RHEL 8, Docker was removed from the official repositories in favor of Podman, their daemonless container engine that is compatible with the Docker CLI. Oracle Linux, being a RHEL derivative, inherits the same setup.

Podman is a great alternative but in my case I needed Docker (also to take advantage of docker compose), so I went with the official repository.

Step 2: removing podman

As a first thing I removed any previous installations and podman, to avoid conflicts with the package versions in the next step.

ShellScript
sudo dnf remove docker \
                docker-client \
                docker-client-latest \
                docker-common \
                docker-latest \
                docker-latest-logrotate \
                docker-logrotate \
                docker-engine \
                podman \
                runc

Step 3: installing docker

As we said, Docker is not in the Oracle Linux repos: we need to add Docker’s official repository for RHEL. This step is also necessary because the docker compose plugin comes from there.

ShellScript
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

Now we can install Docker Engine with all its components:

ShellScript
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

In one go we have: the daemon (docker-ce), the CLI (docker-ce-cli), the runtime (containerd.io) and the plugins for buildx and compose. All that’s left is to enable and start our docker:

ShellScript
sudo systemctl enable --now docker

Step 4: docker hello-world

To test that docker works correctly let’s run the hello-world image

ShellScript
sudo docker run hello-world

Step 5: using Docker without sudo

Running every command with sudo quickly becomes annoying and the correct way is to add your own user to the docker group. As a first step let’s create the group, if it doesn’t already exist:

ShellScript
sudo groupadd docker

In my case the group had already been created by the installation:

Now let’s add our user to the group (and any other users on the machine who will need to manage the service):

ShellScript
sudo usermod -aG docker $USER
sudo usermod -aG docker mario.rossi

Note: to make the group membership effective you need a logout/login (or a restart of the SSH session).

WARNING: the usermod command must be run with elevated privileges

Conclusions

In this article we saw how to install docker as an alternative to podman (which remains the recommended and official choice of Oracle and RedHat). In my case I had a set of tools already prepared with docker-compose that I wanted to migrate to this server, and this forced me not to follow the podman route.

If instead you’re starting from scratch, I recommend considering podman first: in most cases it covers the same needs, it’s already integrated into the official repositories and doesn’t require a running daemon. Choosing Docker still makes sense when you have specific constraints (such as migrating existing setups) or direct dependencies on its ecosystem.

Thanks for reading, see you next time!

Share this article
Shareable URL
Prev Post

What’s new in Angular 22

Next Post

Translations in Angular enterprise application with i18next

Read next