KCloud-Platform-IoT KCloud-Platform-IoT
首页
  • 活动

    • KCloud-Platform-IoT 开源三周年快乐&父亲节快乐
  • 更新日志

    • 4.0.1版本更新日志【总览】
    • 4.0.2版本更新日志
  • 指南

    • 后端项目启动【单体】
    • 前端项目启动【单体】
    • 后端项目启动【微服务】
    • 前端项目启动【微服务】
    • Docker安装
    • Linux常用命令
    • Docker常用命令
    • JVM性能优化
    • 项目配置
    • COLA代码规范
    • OAuth2.1授权服务器配置
    • OAuth2.1资源服务器配置
    • OAuth2.1认证API配置
    • Nacos配置
    • 网关路由配置
    • 项目常用注解
    • Elasticsearch注解
    • Spring Cloud Alibaba配置
    • Spring Cloud Gateway配置
    • gRPC配置
    • ID生成器
    • Flyway配置
赞助
GitHub (opens new window)
首页
  • 活动

    • KCloud-Platform-IoT 开源三周年快乐&父亲节快乐
  • 更新日志

    • 4.0.1版本更新日志【总览】
    • 4.0.2版本更新日志
  • 指南

    • 后端项目启动【单体】
    • 前端项目启动【单体】
    • 后端项目启动【微服务】
    • 前端项目启动【微服务】
    • Docker安装
    • Linux常用命令
    • Docker常用命令
    • JVM性能优化
    • 项目配置
    • COLA代码规范
    • OAuth2.1授权服务器配置
    • OAuth2.1资源服务器配置
    • OAuth2.1认证API配置
    • Nacos配置
    • 网关路由配置
    • 项目常用注解
    • Elasticsearch注解
    • Spring Cloud Alibaba配置
    • Spring Cloud Gateway配置
    • gRPC配置
    • ID生成器
    • Flyway配置
赞助
GitHub (opens new window)
  • 活动

    • KCloud-Platform-IoT 开源三周年快乐&父亲节快乐
  • 更新日志

    • 4.0.1版本更新日志【总览】
    • 4.0.2版本更新日志
  • 指南

    • 后端项目启动【单体】
    • 前端项目启动【单体】
    • 后端项目启动【微服务】
    • 前端项目启动【微服务】
    • Docker安装
      • 查看系统版本及架构
        • 安装 Docker【Amd64 Ubuntu 22.04】
        • 1.更新包索引
        • 2.安装必要的系统工具
        • 3.添加 Docker 官方 GPG 密钥【没添加好就多试几次】
        • 4.添加 Docker 仓库
        • 5.再次更新包索引
        • 6.安装 Docker CE
        • 7.启动 Docker 服务
        • 8.安装Docker Compose
        • 9.远程访问
        • 安装 Docker【Arm64 Ubuntu20.04】
        • 1.卸载旧版本(避免冲突)
        • 2.安装依赖
        • 3.添加 Docker 官方 GPG key
        • 4.添加官方仓库
        • 5.更新包索引
        • 6.安装 Docker CE
    • Linux常用命令
    • Docker常用命令
    • JVM性能优化
    • 项目配置
    • COLA代码规范
    • OAuth2.1授权服务器配置
    • OAuth2.1资源服务器配置
    • OAuth2.1认证API配置
    • Nacos配置
    • 网关路由配置
    • 项目常用注解
    • Elasticsearch注解
    • Spring Cloud Alibaba配置
    • Spring Cloud Gateway配置
    • gRPC配置
    • ID生成器
    • Flyway配置
  • 二开指南
  • 指南
KCloud-Platform-IoT
2026-02-09
目录

Docker安装

你好呀,我的老朋友!我是老寇,欢迎来到老寇IoT云平台!

# 查看系统版本及架构

lsb_release -a
dpkg --print-architecture

# 安装 Docker【Amd64 Ubuntu 22.04】

注意:需要检查是否安装SSH,否则无法连接主机

# 安装
sudo apt-get install openssh-server
# 查看状态
sudo systemctl status ssh
# 启动
sudo systemctl start ssh
# 开机启动
sudo systemctl enable ssh
# 1.更新包索引
sudo apt-get update
# 2.安装必要的系统工具
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# 3.添加 Docker 官方 GPG 密钥【没添加好就多试几次】
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 4.添加 Docker 仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# 5.再次更新包索引
sudo apt-get update
# 6.安装 Docker CE
sudo apt-get install docker-ce
# 7.启动 Docker 服务
## 启动
sudo systemctl start docker
# 查看状态
sudo systemctl status docker
# 开机启动
sudo systemctl enable docker
# 8.安装Docker Compose
sudo wget https://github.com/docker/compose/releases/download/v2.40.3/docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/local/docker-compose
sudo chmod +x /usr/local/docker-compose
# 全局设置
sudo ln -s /usr/local/docker-compose /usr/bin/docker-compose
# 查看版本
docker-compose --version
# 9.远程访问
sudo apt-get install vim
sudo vim /usr/lib/systemd/system/docker.service
# 找到 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock 这行,添加 -H tcp://0.0.0.0:2375
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd:// --containerd=/run/containerd/containerd.sock
sudo systemctl daemon-reload
sudo systemctl restart docker

# 安装 Docker【Arm64 Ubuntu20.04】

# 1.卸载旧版本(避免冲突)
sudo apt-get remove docker docker-engine docker.io containerd runc
# 2.安装依赖
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
# 3.添加 Docker 官方 GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# 4.添加官方仓库
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# 5.更新包索引
sudo apt-get update
# 6.安装 Docker CE
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

我是老寇,我们下次再见啦!

上次更新: 4/12/2026, 2:00:32 PM
前端项目启动【微服务】
Linux常用命令

← 前端项目启动【微服务】 Linux常用命令→

Theme by Vdoing | Copyright © 2022-2026 laokou | Apache 2.0 License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式