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 developing, hands typing computer script..
Image: Song_about_summer/Adobe Stock

Containerd is a container runtime engine 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 image transfer and storage, container deployment and supervision, storage and network, and more.

SEE: Hiring kit: Back-end Developer (TechRepublic Premium)

I’m going to walk you through the process of installing Containerd on Ubuntu Server 22.04. This isn’t quite as simple as installing the Docker runtime engine, but it’s only just a matter of running a few commands. With the introduction out of the way, let’s get right 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 begin with, download the Containerd runtime with the command:

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

Do check the Containerd Download page to ensure you’re downloading the latest release.

Unpack that file into /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:

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, which is used to provide the necessary networking 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

Unpack 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 house 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 verify everything is running 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
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 serve on Ubuntu Server 22.04. Next time up, 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 all the latest tech advice for business pros from Jack Wallen.