Get Docker
You need to install Docker Engine and Docker Compose on your VPS. The following steps will guide you through the installation process.
For production environments, it is recommended to use a Linux-based operating system (for example, Ubuntu or Debian). To install Docker on macOS or Windows, please see the instructions below.
The following is taken from the official Docker documentation, under Apache License 2.0.Install Docker under Linux
Prerequisites
Firewall limitations
Warning
Before you install Docker, make sure you consider the following security implications and firewall incompatibilities.
- If you use ufw or firewalld to manage firewall settings, be aware that when you expose container ports using Docker, these ports bypass your firewall rules. For more information, refer to Docker and ufw.
- Docker is only compatible with
iptables-nftandiptables-legacy. Firewall rules created withnftare not supported on a system with Docker installed. Make sure that any firewall rulesets you use are created withiptablesorip6tables, and that you add them to theDOCKER-USERchain, see Packet filtering and firewalls.
OS requirements
To install Docker Engine, you need one of these Debian versions:
- Debian Trixie 13 (stable)
- Debian Bookworm 12 (oldstable)
- Debian Bullseye 11 (oldoldstable)
Docker Engine for Debian is compatible with x86_64 (or amd64), armhf (arm/v7), arm64, and ppc64le (ppc64el) architectures.
Uninstall old versions
Before you can install Docker Engine, you need to uninstall any conflicting packages.
Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.
The unofficial packages to uninstall are:
docker.iodocker-composedocker-docpodman-docker
Moreover, Docker Engine depends on containerd and runc. Docker Engine
bundles these dependencies as one bundle: containerd.io. If you have
installed the containerd or runc previously, uninstall them to avoid
conflicts with the versions bundled with Docker Engine.
Run the following command to uninstall all conflicting packages:
$ sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1) apt might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in /var/lib/docker/ aren’t
automatically removed when you uninstall Docker. If you want to start with a
clean installation, and prefer to clean up any existing data, read the uninstall Docker Engine section.
Installation
Before you install Docker Engine for the first time on a new host machine, you
need to set up the Docker apt repository. Afterward, you can install and update
Docker from the repository.
Set up Docker’s apt repository
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
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
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update Note
If you use a derivative distribution, such as Kali Linux, you may need to substitute the part of this command that’s expected to print the version codename:
$(. /etc/os-release && echo "$VERSION_CODENAME") Replace this part with the codename of the corresponding Debian release,
such as bookworm.
Install the Docker packages
To install the latest version, run:
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Note
The Docker service starts automatically after installation. To verify that Docker is running, use:
$ sudo systemctl status docker Some systems may have this behavior disabled and will require a manual start:
$ sudo systemctl start dockerVerify that the installation is successful by running the hello-world image
$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.
Prerequisites
Firewall limitations
Warning
Before you install Docker, make sure you consider the following security implications and firewall incompatibilities.
- If you use ufw or firewalld to manage firewall settings, be aware that when you expose container ports using Docker, these ports bypass your firewall rules. For more information, refer to Docker and ufw.
- Docker is only compatible with
iptables-nftandiptables-legacy. Firewall rules created withnftare not supported on a system with Docker installed. Make sure that any firewall rulesets you use are created withiptablesorip6tables, and that you add them to theDOCKER-USERchain, see Packet filtering and firewalls.
OS requirements
To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:
- Ubuntu Questing 25.10
- Ubuntu Plucky 25.04
- Ubuntu Noble 24.04 (LTS)
- Ubuntu Jammy 22.04 (LTS)
Docker Engine for Ubuntu is compatible with x86_64 (or amd64), armhf, arm64, s390x, and ppc64le (ppc64el) architectures.
Note
Installation on Ubuntu derivative distributions, such as Linux Mint, is not officially supported (though it may work).
Uninstall old versions
Before you can install Docker Engine, you need to uninstall any conflicting packages.
Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.
The unofficial packages to uninstall are:
docker.iodocker-composedocker-compose-v2docker-docpodman-docker
Moreover, Docker Engine depends on containerd and runc. Docker Engine
bundles these dependencies as one bundle: containerd.io. If you have
installed the containerd or runc previously, uninstall them to avoid
conflicts with the versions bundled with Docker Engine.
Run the following command to uninstall all conflicting packages:
$ sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc | cut -f1) apt might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in /var/lib/docker/ aren’t
automatically removed when you uninstall Docker. If you want to start with a
clean installation, and prefer to clean up any existing data, read the uninstall Docker Engine section.
Installation
Set up Docker’s apt repository
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
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
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update Install the Docker packages
To install the latest version, run:
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Note
The Docker service starts automatically after installation. To verify that Docker is running, use:
$ sudo systemctl status docker Some systems may have this behavior disabled and will require a manual start:
$ sudo systemctl start dockerVerify that the installation is successful by running the hello-world image
$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.
Prerequisites
OS requirements
To install Docker Engine, you need a maintained version of one of the following RHEL versions:
- RHEL 8
- RHEL 9
- RHEL 10
Uninstall old versions
Before you can install Docker Engine, you need to uninstall any conflicting packages.
Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.
$ sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
podman \
runc dnf might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in /var/lib/docker/ aren’t
automatically removed when you uninstall Docker.
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Installation
Set up the repository
Install the dnf-plugins-core package (which provides the commands to manage
your DNF repositories) and set up the repository.
$ sudo dnf -y install dnf-plugins-core
$ sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo Install the Docker packages
To install the latest version, run:
$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.
This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
Start Docker Engine
$ sudo systemctl enable --now docker This configures the Docker systemd service to start automatically when you
boot your system. If you don’t want Docker to start automatically, use sudo systemctl start docker instead.
Verify that the installation is successful by running the hello-world image
$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.
Prerequisites
OS requirements
To install Docker Engine, you need a maintained version of one of the following CentOS versions:
- CentOS Stream 10
- CentOS Stream 9
The centos-extras repository must be enabled. This repository is enabled by
default. If you have disabled it, you need to re-enable it.
Uninstall old versions
Before you can install Docker Engine, you need to uninstall any conflicting packages.
Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.
$ sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine dnf might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in /var/lib/docker/ aren’t
automatically removed when you uninstall Docker.
Installation
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Set up the repository
Install the dnf-plugins-core package (which provides the commands to manage
your DNF repositories) and set up the repository.
$ sudo dnf -y install dnf-plugins-core
$ sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo Install the Docker packages
To install the latest version, run:
$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.
This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
Start Docker Engine
$ sudo systemctl enable --now docker This configures the Docker systemd service to start automatically when you
boot your system. If you don’t want Docker to start automatically, use sudo systemctl start docker instead.
Verify that the installation is successful by running the hello-world image
$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine.
Install Docker under macOS
System requirements
A supported version of macOS.
Important
Docker Desktop is supported on the current and two previous major macOS releases. As new major versions of macOS are made generally available, Docker stops supporting the oldest version and supports the newest version of macOS (in addition to the previous two releases).
At least 4 GB of RAM.
A supported version of macOS.
Important
Docker Desktop is supported on the current and two previous major macOS releases. As new major versions of macOS are made generally available, Docker stops supporting the oldest version and supports the newest version of macOS (in addition to the previous two releases).
At least 4 GB of RAM.
For the best experience, it’s recommended that you install Rosetta 2. Rosetta 2 is no longer strictly required, however there are a few optional command line tools that still require Rosetta 2 when using Darwin/AMD64. See Known issues. To install Rosetta 2 manually from the command line, run the following command:
$ softwareupdate --install-rosetta
Before you install or update
Quit tools that might call Docker in the background (Visual Studio Code, terminals, agent apps).
Install and run Docker Desktop on Mac
Tip
See the FAQs on how to install and run Docker Desktop without needing administrator privileges.
Install interactively
Download the installer from the release notes.
Double-click
Docker.dmgto open the installer, then drag the Docker icon to the Applications folder. By default, Docker Desktop is installed at/Applications/Docker.app.Double-click
Docker.appin the Applications folder to start Docker.The Docker menu displays the Docker Subscription Service Agreement.
Here’s a summary of the key points:
- Docker Desktop is free for small businesses (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open source projects.
- Otherwise, it requires a paid subscription for professional use.
- Paid subscriptions are also required for government entities.
- Docker Pro, Team, and Business subscriptions include commercial use of Docker Desktop.
Select Accept to continue.
Note that Docker Desktop won’t run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
For more information, see Docker Desktop Subscription Service Agreement. It is recommended that you also read the FAQs.
From the installation window, select either:
- Use recommended settings (Requires password). This lets Docker Desktop automatically set the necessary configuration settings.
- Use advanced settings. You can then set the location of the Docker CLI tools either in the system or user directory, enable the default Docker socket, and enable privileged port mapping. See Settings, for more information and how to set the location of the Docker CLI tools.
Select Finish. If you have applied any of the previous configurations that require a password in step 6, enter your password to confirm your choice.
Install Docker under Windows
System requirements
Tip
Should I use Hyper-V or WSL?
Docker Desktop’s functionality remains consistent on both WSL and Hyper-V, without a preference for either architecture. Hyper-V and WSL have their own advantages and disadvantages, depending on your specific setup and your planned use case.
- WSL version 2.1.5 or later.
- Windows 10 64-bit: Enterprise, Pro, or Education version 22H2 (build 19045).
- Windows 11 64-bit: Enterprise, Pro, or Education version 23H2 (build 22631) or higher.
- Turn on the WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
- The following hardware prerequisites are required to successfully run
WSL 2 on Windows 10 or Windows 11:
- 64-bit processor with Second Level Address Translation (SLAT)
- 4GB system RAM
- Enable hardware virtualization in BIOS/UEFI. For more information, see Virtualization.
For more information on setting up WSL 2 with Docker Desktop, see WSL.
Note
Docker only supports Docker Desktop on Windows for those versions of Windows that are still within Microsoft’s servicing timeline. Docker Desktop is not supported on server versions of Windows, such as Windows Server 2019 or Windows Server 2022. For more information on how to run containers on Windows Server, see Microsoft’s official documentation.
Important
To run Windows containers, you need Windows 10 or Windows 11 Professional or Enterprise edition. Windows Home or Education editions only allow you to run Linux containers.
- Windows 10 64-bit: Enterprise, Pro, or Education version 22H2 (build 19045).
- Windows 11 64-bit: Enterprise, Pro, or Education version 23H2 (build 22631) or higher.
- Turn on Hyper-V and Containers Windows features.
- The following hardware prerequisites are required to successfully run Client
Hyper-V on Windows 10:
- 64 bit processor with Second Level Address Translation (SLAT)
- 4GB system RAM
- Turn on BIOS/UEFI-level hardware virtualization support in the BIOS/UEFI settings. For more information, see Virtualization.
Note
Docker only supports Docker Desktop on Windows for those versions of Windows that are still within Microsoft’s servicing timeline. Docker Desktop is not supported on server versions of Windows, such as Windows Server 2019 or Windows Server 2022. For more information on how to run containers on Windows Server, see Microsoft’s official documentation.
Important
To run Windows containers, you need Windows 10 or Windows 11 Professional or Enterprise edition. Windows Home or Education editions only allow you to run Linux containers.
- WSL version 2.1.5 or later.
- Windows 10 64-bit: Enterprise, Pro, or Education version 22H2 (build 19045).
- Windows 11 64-bit: Enterprise, Pro, or Education version 23H2 (build 22631) or higher.
- Turn on the WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
- The following hardware prerequisites are required to successfully run
WSL 2 on Windows 10 or Windows 11:
- 64-bit processor with Second Level Address Translation (SLAT)
- 4GB system RAM
- Enable hardware virtualization in BIOS/UEFI. For more information, see Virtualization.
Important
Windows containers are not supported.
Containers and images created with Docker Desktop are shared between all user accounts on machines where it is installed. This is because all Windows accounts use the same VM to build and run containers. Note that it is not possible to share containers and images between user accounts when using the Docker Desktop WSL 2 backend.
Running Docker Desktop inside a VMware ESXi or Azure VM is supported for Docker Business customers. It requires enabling nested virtualization on the hypervisor first. For more information, see Running Docker Desktop in a VM or VDI environment.
Administrator privileges and installation requirements
Installing Docker Desktop requires administrator privileges. However, once installed, it can be used without administrative access. Some actions, though, still need elevated permissions. See Understand permission requirements for Windows for more detail.
If your users do not have administrator rights and plan to perform operations that require elevated privileges, be sure to install Docker Desktop using the --always-run-service installer flag. This ensures those actions can still be executed without prompting for User Account Control (UAC) elevation. See Installer Flags for more detail.
WSL: Verification and setup
If you have chosen to use WSL, first verify that your installed version meets system requirements by running the following command in your terminal:
wsl --version If version details do not appear, you are likely using the inbox version of WSL. This version does not support modern capabilities and must be updated.
You can update or install WSL using one of the following methods:
Option 1: Install or update WSL via the terminal
- Open PowerShell or Windows Command Prompt in administrator mode.
- Run either the install or update command. You may be prompted to restart your machine. For more information, refer to Install WSL.
wsl --install
wsl --update Option 2: Install WSL via the MSI package
If Microsoft Store access is blocked due to security policies:
- Go to the official WSL GitHub Releases page.
- Download the
.msiinstaller from the latest stable release (under the Assets drop-down). - Run the downloaded installer and follow the setup instructions.
Install Docker Desktop on Windows
Tip
See the FAQs on how to install and run Docker Desktop without needing administrator privileges.
Download the installer using the download button at the top of the page, or from the release notes.
Double-click
Docker Desktop Installer.exeto run the installer. By default, Docker Desktop is installed atC:\Program Files\Docker\Docker.When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend.
On systems that support only one backend, Docker Desktop automatically selects the available option.
Follow the instructions on the installation wizard to authorize the installer and proceed with the installation.
When the installation is successful, select Close to complete the installation process.
Start Docker Desktop (see below).
If your administrator account is different to your user account, you must add the user to the docker-users group to access features that require higher privileges, such as creating and managing the Hyper-V VM, or using Windows containers:
- Run Computer Management as an administrator.
- Navigate to Local Users and Groups > Groups > docker-users.
- Right-click to add the user to the group.
- Sign out and sign back in for the changes to take effect.
Start Docker Desktop
Docker Desktop does not start automatically after installation. To start Docker Desktop:
Search for Docker, and select Docker Desktop in the search results.
The Docker menu displays the Docker Subscription Service Agreement.
Here’s a summary of the key points:
- Docker Desktop is free for small businesses (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open source projects.
- Otherwise, it requires a paid subscription for professional use.
- Paid subscriptions are also required for government entities.
- Docker Pro, Team, and Business subscriptions include commercial use of Docker Desktop.
Select Accept to continue. Docker Desktop starts after you accept the terms.
Note that Docker Desktop won’t run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
For more information, see Docker Desktop Subscription Service Agreement. It is recommended that you read the FAQs.