Jack Wallen walks you through the process of manually installing Containerd container runtime on Ubuntu Server 22.04.
Containerd is a container runtime created for simplicity and portability. This runtime is considered an industry standard and is available as a daemon for Linux and Windows and can manage the entire container lifecycle for transferring and storing images, deploying and monitoring containers, storage and network, etc.
SEE: Recruitment kit: Back-end developer (TechRepublic Premium)
I will walk you through the process of installing Containerd on Ubuntu Server 22.04. It’s not as simple as installing the Docker runtime, but it only takes a few commands to run. After the introduction, let’s go straight to the installation.
How to Install Containerd on Ubuntu Server
There are a few pieces to this puzzle, the first of which is the Containerd runtime itself. To get started, download the Containerd runtime with the command:
Check the Container download page to make sure you are downloading the latest version.
Unzip this file in /usr/local/ with the command:
sudo tar Cxzvf /usr/local containerd-1.6.8-linux-amd64.tar.gz
Next, we need the runc command line tool which is used to deploy containers with Containerd. Download this package with:
Install runc with:
sudo install -m 755 runc.amd64 /usr/local/sbin/runc
Now we need the container network interface, which is used to provide the necessary networking functionality. Download CNI with:
Create a new directory with:
sudo mkdir -p /opt/cni/bin
Unzip the CNI file into our new directory with:
sudo tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.1.1.tgz
How to configure Containerd
With everything installed, we can now configure Containerd. Create a new directory to host the Containerd configurations with:
sudo mkdir /etc/containerd
Create configurations with:
containerd config default | sudo tee /etc/containerd/config.toml
Enable SystemdCgroup with the command:
sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
Download the required systemd file with:
sudo curl -L https://raw.githubusercontent.com/containerd/containerd/main/containerd.service -o /etc/systemd/system/containerd.service
Reload the systemd daemon with:
sudo systemctl daemon-reload
Finally, start and enable the Containerd service with:
sudo systemctl enable --now containerd
You can check that everything is working with the command:
sudo systemctl status containerd
You should see output similar to this:
containerd.service - containerd container runtime
Loaded: loaded (/etc/systemd/system/containerd.service; enabled; vendor pre>
Active: active (running) since Wed 2022-09-21 12:17:24 UTC; 6s ago
Process: 1475 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUC>
Main PID: 1478 (containerd)
Congratulations, you now have Containerd container runtime ready to serve on Ubuntu Server 22.04. Next time we will pull an image and deploy a container with this powerful system.
Subscribe to TechRepublic How to make the technology work on YouTube for all the latest tech tips for professionals from Jack Wallen.