Containerd is an industry-standard core container runtime that manages the complete container lifecycle of image transfer and storage, container execution and supervision, and low-level storage and image management. In this guide, we will walk you through the installation of Containerd on Ubuntu 22.04. Whether you are deploying it on a local server or using a Windows VPS UK, this tutorial will cover all the necessary steps.
Step 1: Update Your System
Before installing Containerd, ensure your system is up to date. Run the following commands:
sudo apt update && sudo apt upgrade -y
Keeping your system updated is crucial for security and performance, whether you're setting it up locally or on a VPS Windows Servers platform.
Step 2: Install Required Dependencies
Containerd requires some dependencies to run. Install these packages with the following command:
sudo apt install -y apt-transport-https ca-certificates curl
Step 3: Add the Containerd Repository
To install the latest version of Containerd, you need to add its official repository. First, add the Docker GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Then, add the Docker repository to your APT sources:
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
Step 4: Install Containerd
After adding the repository, update the package list and install Containerd:
sudo apt update
sudo apt install containerd.io -y
Step 5: Configure Containerd
After installation, you need to configure Containerd. Create a default configuration file using the following command:
sudo containerd config default | sudo tee /etc/containerd/config.toml
This command generates a default configuration file at `/etc/containerd/config.toml`.
Step 6: Restart and Enable Containerd
Now, restart the Containerd service to apply the configuration:
sudo systemctl restart containerd
Enable Containerd to start on boot:
sudo systemctl enable containerd
Step 7: Verify Containerd Installation
To ensure Containerd is installed and running correctly, check the service status:
sudo systemctl status containerd
You should see an output indicating that the service is active and running.
Step 8: Use Containerd
You can now use Containerd to manage your containers. For example, you can use the following command to list the available containers:
sudo ctr containers list
This command will show any containers that are managed by Containerd.