在 Windows 云服务器上安装 Docker,系统版本要求取决于你使用的是哪种 Docker 解决方案。目前,在 Windows 上运行 Docker 主要有两种方式:
✅ 方式一:使用 Docker Desktop for Windows(推荐用于开发和测试)
📌 系统要求:
-
操作系统版本:
- Windows 10 64位:Pro、Enterprise 或 Education(Build 19041 及以上,即 20H1 或更高版本)
- Windows 11 64位:Pro、Enterprise 或 Education
- ❌ 不支持 Windows Home 版本(除非使用 WSL2 后端并手动配置,但官方不推荐用于生产)
-
必须启用的组件:
- WSL 2(Windows Subsystem for Linux 2)
- Hyper-V(如果不用 WSL2,则需要 Hyper-V 支持)
- 虚拟化功能(在 BIOS 中开启 VT-x/AMD-V)
-
硬件要求:
- 至少 4GB 内存(建议 8GB+)
- 64 位处理器
- 至少 20GB 可用磁盘空间
⚠️ 注意:Windows Server 系统不支持 Docker Desktop。
✅ 方式二:在 Windows Server 上使用原生容器(适用于生产环境)
如果你使用的是 Windows Server 云服务器(如 Windows Server 2019 / 2022),可以安装 原生 Windows 容器(非 Linux 容器),通过 PowerShell 安装 Docker Engine。
📌 支持的操作系统版本:
- Windows Server 2019(版本 1809 及以上)
- Windows Server 2022(推荐)
- 必须是 64位 系统
- 需要以 Full Installation(完整安装) 模式运行(Server Core 也可支持)
📦 安装方式(使用 PowerShell):
# 安装容器功能
Install-WindowsFeature -Name Containers
# 重启服务器
Restart-Computer -Force
# 安装 Docker Engine
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
# 启动 Docker 服务
Start-Service Docker
🔹 此方式仅支持运行 Windows 容器,不支持 Linux 容器(除非配置了 LCOW,但已废弃)。
🚫 常见误区澄清:
- Windows Server 不能安装 Docker Desktop。
- Windows 云服务器若想运行 Linux 容器,必须使用 WSL2 + Docker Desktop(仅限 Win10/Win11 Pro)。
- 普通 Windows Server 只能运行 Windows 容器。
✅ 推荐选择(根据场景):
| 使用场景 | 推荐系统 | 安装方式 |
|---|---|---|
| 开发/测试(带 GUI) | Windows 10/11 Pro | Docker Desktop + WSL2 |
| 生产部署(Windows 应用) | Windows Server 2019/2022 | 原生容器(PowerShell 安装) |
| 需要运行 Linux 容器 | Windows 10/11 Pro/Enterprise | Docker Desktop + WSL2 |
✅ 总结:
要在 Windows 云服务器上安装 Docker,请根据你的系统类型选择:
- 如果是 Windows 10/11 Pro/Enterprise → 使用 Docker Desktop(需 WSL2 和 Hyper-V)
- 如果是 Windows Server 2019/2022 → 使用 原生容器(PowerShell 安装,仅支持 Windows 容器)
请确保云服务器提供商支持嵌套虚拟化(尤其是使用 WSL2 时),否则可能无法正常运行。
如有具体云平台(如阿里云、腾讯云、AWS、Azure),可进一步确认镜像是否支持虚拟化。
云小栈