安装指南

How to Install Docker on Ubuntu 22.04 LTS

通过这篇全面的分步指南,学习如何在 Ubuntu 22.04 LTS 上安装 Docker。

December 20, 2025 2830 浏览

How to Install Docker on Ubuntu 22.04 LTS

This comprehensive guide will walk you through installing Docker on Ubuntu 22.04 LTS. Follow these steps carefully to ensure a successful installation.

Prerequisites

  • A fresh Ubuntu 22.04 LTS server
  • Root or sudo access
  • At least 2GB of RAM
  • 20GB of available disk space

Step 1: Update System Packages

First, ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Dependencies

Install required dependencies:

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

Step 3: Install Docker

Now install Docker using the package manager:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Step 4: Start and Enable Service

Start the Docker service and enable it to run on boot:

sudo systemctl start docker
sudo systemctl enable docker

Step 5: Configure Docker

Edit the configuration file located at /etc/docker/daemon.json:

sudo nano /etc/docker/daemon.json

Step 6: Verify Installation

Check that Docker is running correctly:

sudo docker --version
sudo docker run hello-world

Conclusion

Congratulations! You now have Docker running on Ubuntu 22.04 LTS. For additional configuration options, refer to the official Docker documentation.

请为这篇文章评分

-
Loading...

搜索文档