# How to install Docker on CentOS 7

[Docker](https://www.ionos.com/digitalguide/server/know-how/what-is-docker/) is an open source platform that lets you create and run applications in so-called **containers**. Containers are isolated environments that contain all the necessary **dependencies** of an application. Since Linux-based operating systems like [CentOS](https://www.ionos.com/digitalguide/server/know-how/what-is-centos-versions-system-requirements/) are very popular development platforms, this system fits very well with Docker. We’ll show you how to quickly and easily get Docker installed and running on your CentOS 7 system.

## System requirements

Docker is standard software and doesn’t demand high hardware requirements. Nevertheless, its software requirements are somewhat specific. To ensure clarity, we’ve compiled a list of all the system requirements for you:

- 64-bit CPU that supports virtualization
- 4 GB of RAM
- **Gnome, KDE or MATE** as desktop environment
- Support for KVM virtualization
- QEMU (at least version 5.2)
- System

## The right server

Depending on your application, it might be more optimal to run Docker on a server rather than on your local machine. Various types of servers are suitable for different application scenarios.

With **virtualized servers** like the [cloud server](https://www.ionos.com/cloud/cloud-servers "Cloud Server by IONOS") or the [VPS](https://www.ionos.com/servers/vps "VPS Hosting by IONOS") (Virtual Private Server) from IONOS you benefit from scalable resources at any time. This means you won’t need to manage any overhead when acquiring a server – your server will consistently have precisely the required resources available. The two server types vary in terms of billing. Cloud servers provide **minute billing**, while VPS servers are billed at a **monthly fixed price**.

If a virtualized server is not sufficient for your purposes, IONOS also offers a [dedicated server](https://www.ionos.com/servers/dedicated-servers "Dedicated Server from IONOS"), where resources are reserved around the clock. To achieve this, dedicated servers are powered by **cutting-edge enterprise-grade hardware**, guaranteeing your application always benefits from peak performance. Similar to the cloud server, dedicated server billing is also done on a minute-by-minute basis.

<table>
  <thead>
    <tr>
      <th>Application</th>
      <th>Matching Server Type</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Server for developing your application; you only pay for the time you actually use the server for testing the application</td>
      <td>Cloud Server XL</td>
    </tr>
    <tr>
      <td>Server for developing or deploying an application that requires continuous or frequent online availability</td>
      <td>VPS Linux XL</td>
    </tr>
    <tr>
      <td>For deploying resource-intensive applications that demand top-tier security and performance, opt for an enterprise-level server. This ensures your application consistently operates on secure and high-performance hardware without sharing resources</td>
      <td>Dedicated Server</td>
    </tr>
  </tbody>
</table>

## Installation using yum

On Linux, like on most other systems, there are multiple methods for installing software. Installing through a **package manager** is often the simplest approach. CentOS, for instance, uses yum as its default package manager. To install Docker using **yum**, you just need to follow a few steps.

**Step 1: Update yum and all packages**

First you should update your package manager, your installed packages and your *Linux core*. To do this, enter the following command in your shell:

```bash
sudo yum update
```

[![Image: Display after yum update](https://www.ionos.com/digitalguide/fileadmin/_processed_/5/4/csm_docker-cent-os-7-yum-update-english_09c1d29e15.webp "Display after yum update")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-yum-update-english.png) Terminal display after yum update If you’ve already used Docker on your system, you should **remove all Docker components** before installation. To do this, enter the following command. If you’ve never had Docker installed on your system, you can skip this step.

```bash
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
```

**Step 2: Install dependencies**

Depending on the frequency of your software updates, the process may take a few minutes. Once the update is finished, you should execute the following command to install the necessary dependencies for Docker:

```bash
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
```

[![Image: Display after dependencies have been installed](https://www.ionos.com/digitalguide/fileadmin/_processed_/5/5/csm_docker-cent-os-7-dependencies-english_17becab09b.webp "Display after dependencies have been installed")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-dependencies-english.png) Terminal display after dependencies have been installed **Step 3: Add Docker repository**

Now you need to add the **Docker repository to your package manager**. To do this, enter the following command:

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

[![Image: Display once repository has been added](https://www.ionos.com/digitalguide/fileadmin/_processed_/1/7/csm_docker-cent-os-7-repo-english_d472191fe5.webp "Display once repository has been added")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-repo-english.png) Terminal display after --add-repo  Note The above command adds the **Docker Community Edition (CE)** repository to your package manager. To install **Docker Enterprise Edition (EE)**, you should replace the above URL with the URL of your Docker EE license.

**Step 4: Install Docker**

Now it’s time to install Docker on your CentOS system. To complete the installation process, use this command:

```bash
sudo yum install docker-ce
```

[![Image: Display after installing Docker on CentOS](https://www.ionos.com/digitalguide/fileadmin/_processed_/f/a/csm_docker-cent-os-7-docker-installed-english_1d27a553c9.webp "Display after installing Docker on CentOS")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-docker-installed-english.png) Terminal display after install docker-ce  Tip Besides docker-ce (formerly known as Docker Engine), other essential Docker components like Docker Compose, containerd, and the Docker CE CLI version are often included. If you wish to install these components alongside, please use the following shell command instead of the previous one: `sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`

You can now test if the installation was successful using the following commands:

```bash
sudo systemctl start docker
sudo docker run hello-world
```

[![Image: Check Docker installation on CentOS](https://www.ionos.com/digitalguide/fileadmin/_processed_/9/9/csm_docker-cent-os-7-hello-world-english_df64ea13cd.webp "Check Docker installation on CentOS")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-hello-world-english.png) Terminal display after Docker installation ## Manual installation

If you’re unable or prefer not to use the Docker repository, you have the option to manually install the Docker package. Keep in mind that with this method, **your Docker installation won’t receive automatic updates**, and you’ll need to manage updates manually. Before proceeding with the manual installation, please make sure to complete steps 1 and 2 from the instructions mentioned earlier.

**Step 1: Download Docker**

First, go to the [Docker website](https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ "Docker stable packages") and select the version you need. We suggest choosing the latest version that begins with `docker-ce` (not the `cli` or `rootless` versions). Make sure to remember the location where you save this *.rpm* file.

**Step 2: Install package**

In your shell, run the following command, replacing `/package.rpm` with the path to the Docker package you downloaded.

```bash
sudo yum install /paket.rpm
```

[![Image: Check manual Docker installation on CentOS](https://www.ionos.com/digitalguide/fileadmin/_processed_/3/5/csm_docker-cent-os-7-manual-installation-english_cf7ecd6ece.webp "Check manual Docker installation on CentOS")](https://www.ionos.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2023/docker-cent-os-7-manual-installation-english.png) Terminal display after manual Docker installation has been checked  Tip The virtualization software Docker is not only available for CentOS, but many other operating systems. Find out how to [install Docker on Ubuntu 20.04](https://www.ionos.com/digitalguide/server/configuration/install-docker-on-ubuntu-2004/), [set up Docker on Debian 11](https://www.ionos.com/digitalguide/server/configuration/install-docker-on-debian-11/) or [Docker on Windows 11](https://www.ionos.com/digitalguide/server/configuration/docker-windows-11/).


This is a markdown version of: [https://www.ionos.com/digitalguide/server/configuration/install-docker-on-centos-7/](https://www.ionos.com/digitalguide/server/configuration/install-docker-on-centos-7/) for AI/LLM consumption.