---
title: "How to Install Docker on RHEL and Ubuntu"
slug: "how-to-install-docker-on-rhel-and-ubuntu"
updated: 2025-12-23T15:05:10Z
published: 2025-12-23T15:05:10Z
canonical: "docs.swxtch.io/how-to-install-docker-on-rhel-and-ubuntu"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swxtch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Install Docker on RHEL and Ubuntu

> [!NOTE]
> **WHAT TO EXPECT**
> 
> **In this section**, users will learn how to install Docker Engine for either RHEL or Ubuntu. For a more detailed instructions, see their respective pages on the Docker documentation site:
> 
> - **Ubuntu**: [https://docs.docker.com/engine/install/ubuntu/](https://docs.docker.com/engine/install/ubuntu/)
> - **RHEL**: [https://docs.docker.com/engine/install/rhel/](https://docs.docker.com/engine/install/rhel/)

> [!WARNING]
> PLEASE NOTE
> 
> For virtual machines it is **NOT** recommended to install Docker Desktop. Use **Docker Engine** instead.
> 
> For bare metal machines that will run swxtch.io software it is still recommended to use Docker Engine, unless there is a full desktop environment with a display server like X11 or Wayland.

> [!TIP]
> **PLEASE NOTE**
> 
> There are two ways to get Docker. The official (Docker-CE or Community Edition), maintained and hosted by Docker Inc. and Docker.io, maintained and distributed by the OS (RHEL, Ubuntu, etc).
> 
> swxtch.io software works with both. But when installing our software using the `--auto_deps` argument will automatically download docker.io.
> 
> If docker-ce is needed, then the user must install first that Docker manually, and then install our software.

### Installing Docker-ce on RHEL

1. Run the following command to prepare the repositories for the Docker install:

```shell
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
cat /etc/yum.repos.d/docker-ce.repo
sudo sed -i 's/$releasever/9/g' /etc/yum.repos.d/docker-ce.repo
cat /etc/yum.repos.d/docker-ce.repo
sudo dnf -y install dnf-plugins-core
```
2. Install Docker-ce:

```shell
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
3. Continue on to [Enabling Docker](/v2/docs/how-to-install-docker-on-rhel-and-ubuntu#enabling-docker).

### Installing Docker-ce on Ubuntu

1. Install Docker:

```shell
curl https://get.docker.com/ > dockerinstall && chmod 777 dockerinstall && sudo ./dockerinstall
```
2. Continue on to [Enabling Docker](/v2/docs/how-to-install-docker-on-rhel-and-ubuntu#enabling-docker).

### Enabling Docker

After installing Docker-ce, run the following commands to enable it on your machine:

```bash
sudo usermod -aG docker $USER
sudo systemctl enable docker
sudo systemctl start docker
```
