How to install the Containerd runtime engine on Ubuntu Server 22.04

Jack Wallen walks you through the process of manually installing the containerd container runtime engine on Ubuntu Server 22.04.

Programming code writing, software coding development, hands typing computer scripts.
Image: Song_about_summer/Adobe Stock

Containerd is a container runtime engine built for simplicity and portability. Industry standard, this runtime is available as a daemon for Linux and Windows and can manage the entire container lifecycle for image transfer and storage, container deployment and monitoring, storage and networking, and more.

SEE: Hire Kit: Backend Developer (TechRepublic Premium)

I will walk you through the process of installing Containerd on Ubuntu Server 22.04. This isn’t quite as easy as installing the Docker runtime engine, but it’s just a matter of running a few commands. After the introduction, let’s go straight to the installation.

How to Install Containerd on Ubuntu Server

This puzzle consists of a few pieces, the first of which is the Containerd runtime itself. First, download the Containerd runtime with the following command:

wget https://github.com/containerd/containerd/releases/download/v1.6.8/containerd-1.6.8-linux-amd64.tar.gz

Check the Containerd download page to make sure you’re downloading the latest version.

Extract this file to /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 pack with:

wget https://github.com/opencontainers/runc/releases/download/v1.1.3/runc.amd64

install runc with:

sudo install -m 755 runc.amd64 /usr/local/sbin/runc

Now we need the Container Network Interface that will be used to provide the necessary network functionality. Download CNI with:

wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz

Create a new directory with:

sudo mkdir -p /opt/cni/bin

Extract the CNI file to 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 for the containerd configurations with:

sudo mkdir /etc/containerd

Create the 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 if everything is running with the command:

sudo systemctl status containerd

You should see output similar to the following:

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
Docs: https://containerd.io
Process: 1475 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUC>
Main PID: 1478 (containerd)
Tasks: 8
Memory: 19.4M
CPU: 257ms
CGroup: /system.slice/containerd.service
└─1478 /usr/local/bin/containerd

Congratulations, you now have the containerd container runtime engine ready to run on Ubuntu Server 22.04. Next time we’ll pull down an image and deploy a container with this powerful system.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for the latest tech advice for business professionals from Jack Wallen.

Leave a Reply

Your email address will not be published. Required fields are marked *