---
title: "How to Install Docker on AlmaLinux 9 and Ubuntu 24.04"
description: "Docker publishes its own package repositories, and installing from them gets you the current release of Docker Engine and keeps it updated from the same source. This guide shows you how to install Doc..."
url: https://www.inmotionhosting.com/support/edu/software/install-docker-almalinux-ubuntu/
date: 2026-08-20
modified: 2026-08-20
author: "Derrell"
categories: ["Software"]
type: post
lang: en
---

# How to Install Docker on AlmaLinux 9 and Ubuntu 24.04

Docker publishes its own package repositories, and installing from them gets you the current release of Docker Engine and keeps it updated from the same source. This guide shows you how to install Docker on AlmaLinux 9 and Ubuntu 24.04. You end up with Docker Engine, the Docker command-line interface (CLI), and Docker Compose in one pass. By the end, the Docker service will be running and ready to pull your first container.

**Skip the installation:** Docker-Ready VPS plans ship with Docker Engine and Docker Compose preinstalled. Select **Docker-Ready** under Control Panel Options when you configure any [VPS plan](https://www.inmotionhosting.com/vps-hosting) (it is a free selection) and choose AlmaLinux 9 or Ubuntu 24.04 as the operating system. On a Docker-Ready server, you can jump straight to the** Verify the Docker Installation section**; verification, the non-root user setup, and the support limitations in this guide still apply.

## Prerequisites

- A VPS or Dedicated Server with root Secure Shell (SSH) access.
- AlmaLinux 9 or Ubuntu 24.04 installed on the server.

## How to Install Docker on AlmaLinux 9

AlmaLinux is binary compatible with Red Hat Enterprise Linux (RHEL), so you install Docker on AlmaLinux 9 from Docker’s own repository, following the steps in Docker’s [CentOS installation guide](https://docs.docker.com/engine/install/centos/). Connect over SSH as root, then run the following commands in order.

**Note:** Docker publishes per-distribution install instructions for CentOS, RHEL, Fedora, Debian, Ubuntu, and Raspberry Pi OS, but not for AlmaLinux. Docker’s documentation states that it “doesn’t test or verify installation on distribution derivatives,” so treat the steps below as Docker’s CentOS path applied to AlmaLinux 9.

### Step 1: Add Docker’s Repository

First, install the `dnf-plugins-core` package. It adds the `config-manager` command you need to register a new repository.

```
sudo dnf -y install dnf-plugins-core
```

Next, add Docker’s repository. The repository file uses your release version, so it resolves to Docker’s Enterprise Linux 9 packages on AlmaLinux 9.

```
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```

### Step 2: Install Docker Engine and Compose

Install Docker Engine, the CLI, containerd, and the Buildx and Compose plugins together.

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

### Step 3: Start the Docker Service

Enable the Docker service so it starts on boot, and start it immediately with the same command.

```
sudo systemctl enable --now docker
```

## How to Install Docker on Ubuntu 24.04

Ubuntu packages Docker in its `universe` repository under the name `docker.io`, on Ubuntu’s own version scheme. To get Docker Engine from Docker instead, install Docker on Ubuntu 24.04 from Docker’s apt repository, following Docker’s [official Ubuntu installation guide](https://docs.docker.com/engine/install/ubuntu/). Docker lists Ubuntu 24.04 as a supported release under the codename `noble`, which shows up in the repository line below.

### Step 1: Install Prerequisite Packages

Update your package index and install the tools Docker’s setup needs to fetch and verify packages over Hypertext Transfer Protocol Secure (HTTPS).

```
sudo apt-get update
sudo apt-get install ca-certificates curl
```

### Step 2: Add Docker’s GPG Key

Create the keyring directory and download Docker’s GNU Privacy Guard (GPG) key into it. The apt package manager uses this key to verify that packages actually came from Docker.

```
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
```

### Step 3: Add Docker’s Repository

Add the Docker repository for the `noble` release, then refresh your package index so apt sees the new source.

```
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  noble stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```

### Step 4: Install Docker Engine and Compose

Install Docker Engine, the CLI, containerd, and the Buildx and Compose plugins together.

```
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

### Step 5: Start the Docker Service

Enable the Docker service so it starts on boot, and start it immediately with the same command.

```
sudo systemctl enable --now docker
```

## Verify the Docker Installation

Confirm Docker is installed correctly before you build or pull anything. Check the Docker CLI version:

```
docker --version
```

Check that Docker Compose is available:

```
docker compose version
```

**Note:** Modern Docker installs Compose as a plugin, invoked as `docker compose` with a space. The older standalone `docker-compose` binary (with a hyphen) is not part of this install, and you do not need it.

Run the standard test container to confirm Docker can pull an image and start a container end to end.

```
sudo docker run hello-world
```

A short message starting with `Hello from Docker!` confirms your installation is working. With Docker verified, set up a non-root account so you are not typing `sudo` before every command.

## Allow a Non-Root User to Run Docker

By default, only root and members of the `docker` group can run Docker commands. Add your working user to that group so you can run `docker` without `sudo` on every command.

```
sudo usermod -aG docker 
```

Replace `<username>` with the account you want to grant access to. Log out and log back in (or start a new SSH session) for the group change to take effect.

**Warning:** Membership in the `docker` group grants root-level privileges on the host. A user in that group can mount the host filesystem into a container and read or modify any file root can. Only add accounts you would trust with root SSH access.

## Docker Support Limitations and Scope

Docker on a VPS or Dedicated Server is a self-managed configuration. Know these limits before you build on it:

- Root SSH access is required to install Docker, since every install command in this guide runs as root.
- InMotion Hosting Technical Support does not troubleshoot Docker-specific issues, such as container configuration, Dockerfile errors, or orchestration. For advanced Docker help, contact the [InMotion Solutions](https://www.inmotionhosting.com/solutions) team.
- Docker-Ready VPS servers are self-managed and do not include a control panel such as cPanel or Control Web Panel.
- Kernel changes are not supported on a Docker-Ready VPS. This includes custom kernels and additional kernel modules.

## Troubleshooting

### Permission denied while connecting to the Docker daemon

This error means your current shell session doesn’t yet reflect the new group membership. Log out and log back in (or start a new SSH session) after you run `usermod -aG docker`, then run `docker ps` again. If the error persists, confirm the username you added matches the account you are logged in as.

### Repository or GPG key errors during installation

A `NO_PUBKEY` error or a 404 response during `apt-get update` usually points at the keyring file or the repository line. Confirm `/etc/apt/keyrings/docker.asc` exists, re-run the `curl` command from the GPG key step, then check `/etc/apt/sources.list.d/docker.list` against the repository line in Step 3.

### Cannot connect to the Docker daemon after installation

This error means the Docker service is not running. Check its status with `sudo systemctl status docker`. If the output shows `inactive` or `failed`, start the service with `sudo systemctl enable --now docker` and review the output for the underlying error.

## Conclusion

You now have Docker Engine and Docker Compose running on AlmaLinux 9 or Ubuntu 24.04, straight from Docker’s official repositories, with a non-root user ready to run containers. From here, learn how to pull images, start containers, and manage them day-to-day in [Working with Docker Containers](https://www.inmotionhosting.com/support/edu/software/working-with-docker-ultimate-guide/), or read [What is Docker?](https://www.inmotionhosting.com/support/edu/software/what-is-docker/) for a refresher on the concepts behind images, containers, and volumes.
