Manual Docker Installation on Older Servers Like Cent OS 7

Table of Contents

  • Manually Installing Docker Binary Files
  • Downloading Docker Binaries
  • Granting Execution Permissions
  • Adding Docker Command Path
  • Registering the Docker Service
  • Starting and Enabling the Service
  • Manually Installing Containerd
  • Downloading the Containerd Binary
  • Accessing the Containerd Release Page
  • Downloading the Compressed File
  • Extracting the Archive
  • Creating a systemd Service File
  • Writing the Service File
  • Creating a Basic Configuration File
  • Starting and Enabling the Service
  • Verifying the Installation
  • Manually Installing Docker Compose (Optional)
This post is part of the Coupang Partners Program and may contain affiliate links, for which I may receive a commission.

Manual Docker Installation on Older Servers Like Cent OS 7

KissCuseMe
2025-04-11
41

Manually Installing Docker Binary Files

You can directly download and install Docker binary files. This method is useful when the network environment is limited or when you want to avoid specific dependencies.


Downloading Docker Binaries

Download the latest version of the Docker binaries from the official Docker GitHub repository:

BASH
mkdir -p /usr/local/bin
cd /usr/local/bin
curl -L https://download.docker.com/linux/static/stable/x86_64/docker-20.10.23.tgz -o docker.tgz
tar xzvf docker.tgz
rm docker.tgz

Granting Execution Permissions

Grant execution permissions to the downloaded binary files:

BASH
chmod +x docker/*

Adding Docker Command Path

Add the Docker command to the system path:

BASH
ln -s /usr/local/bin/docker/docker /usr/bin/docker
ln -s /usr/local/bin/docker/docker-proxy /usr/bin/docker-proxy

Registering the Docker Service

To register Docker as a service, create a systemd service file:

BASH
sudo vi /etc/systemd/system/docker.service

Add the following content:

INI
[Unit]
Description=Docker Application Container Engine
After=network.target

[Service]
Type=notify
ExecStart=/usr/local/bin/docker/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process

[Install]
WantedBy=multi-user.target

Starting and Enabling the Service

Start the service and set it to run automatically at boot time:

BASH
sudo systemctl daemon-reload
sudo systemctl start docker
sudo systemctl enable docker

Manually Installing Containerd

Here's how to install containerd as a binary. This method involves downloading and installing the binary directly without using a package manager (yum, apt). This can help resolve dependency issues or install the latest version in specific environments.


Downloading the Containerd Binary


Accessing the Containerd Release Page

Download the latest version of the binary from the official containerd GitHub release page:

BASH
https://github.com/containerd/containerd/releases

Downloading the Compressed File

For Linux environments, select the containerd--linux-amd64.tar.gz file. For example:

BASH
wget https://github.com/containerd/containerd/releases/download/v1.7.0/containerd-1.7.0-linux-amd64.tar.gz

Extracting the Archive

Extract the downloaded file to the /usr/local directory:

BASH
sudo tar Cxzvf /usr/local containerd-1.7.0-linux-amd64.tar.gz

Creating a systemd Service File

Create a systemd service file to run containerd as a service.


Writing the Service File

BASH
sudo vi /etc/systemd/system/containerd.service

Add the following content:

INI
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
ExecStart=/usr/local/bin/containerd
Restart=always
RestartSec=5
KillMode=process
OOMScoreAdjust=-999
Delegate=yes
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity

[Install]
WantedBy=multi-user.target

Creating a Basic Configuration File

containerd requires a configuration file (/etc/containerd/config.toml).

BASH
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml

Starting and Enabling the Service

Once the installation is complete, start the containerd service and set it to run automatically at boot time:

BASH
sudo systemctl daemon-reload
sudo systemctl start containerd
sudo systemctl enable containerd

Verifying the Installation

Verify that containerd is installed correctly:

BASH
ctr version

Manually Installing Docker Compose (Optional)

If you also need Docker Compose, you can directly download and install the binary file:

BASH
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Docker
manual installation
CentOS7

0


Terms of ServicePrivacy PolicySupport
© 2025
I Wish I Had Known Earlier
All rights reserved.