Linux installation
For CentOS, OpenAnolis, and OpenCloudOS
Quick install script
You can download Docker's installation script with:
curl -fsSL get.docker.com -o get-docker.sh
Manual installation
If you want to install it directly, run:
yum install docker-ce -y
If the package cannot be found, set up the required repository first and then refresh the cache:
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
yum makecache
For Ubuntu and Debian
Update the system, install the required tools, add Docker's GPG key and repository, then install Docker:
apt update
apt upgrade -y
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates
curl -sS https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Windows installation
For Windows, prepare a Windows 10 system first. Using Docker on versions below Windows 10 is not recommended.
Before installing Docker Desktop, enable Hyper-V:
- Right-click the Windows button, open Apps and Features, then click Programs and Features in the upper-right area. Find Hyper-V and check all related options.
- You can also press Win + I to open Settings, go to Apps, and then follow the same steps above.
After Hyper-V is enabled, download Docker Desktop, go through the installation with Next, and finish by clicking Finish.
If no Docker icon appears on the desktop after installation, search for Docker from the Start menu, launch it there, and create a desktop shortcut manually if needed.
Once Docker is installed, open cmd or another shell and run docker run hello-world to check whether Docker starts downloading the image normally.