Discover how to install Docker on CentOS offline with our detailed guide. Follow step-by-step instructions to set up Docker without an internet connection, ensuring a smooth and successful installation. #centlinux #linux #docker
Table of Contents
What is Docker?
Docker is a computer software, that performs operating-system-level virtualization, also known as Containerization. Docker is developed by Docker Inc. Docker uses predefined and custom images to create and run containers. These images are provided through Docker Hub (an online Docker registry).
Containers are isolated from each other having their own set of binaries, libraries and configuration files. Unlike virtual machines, containers may or may not have their own operating systems. The containers are run by the host operating system Kernel, therefore, a container is much light weight as compare to a Hypervisor based virtual machine.
Docker is an important part of today’s DevOps environments, where it is mostly used for application virtualization..
Docker is a freemium software. Because a Community Edition (CE) with limited features is available as free while an Enterprise Edition (EE) is available with more features and a license cost.

Docker is also provided with Red Hat Atomic Host 7, which is a RHEL 7 based operating system optimized for hosting containers. You can read our previous guide about installation of Red Hat Atomic Host 7.
Read Also: How to install Docker on Rocky Linux 9
Environment Specification
In this article, we are using two isolated CentOS 7 based Linux servers. One server has access to Internet, while the other server isn’t connected with Internet.
Offline Server | Online Server | |
Hostname: | docker-offline.example.com | docker-online.example.com |
Operating System: | CentOS 7.6 | CentOS 7.6 |
Internet: | No | Yes |
Linux operating systems on both machines must be same, otherwise the software package versions may not matched and it won’t work.
Recommended Training: Docker for the Absolute Beginner – Hands On – DevOps from Mumshad Mannambeth

Install EPEL Yum Repository on CentOS 7
By using a ssh client, connect with docker-online.example.com as root user.
To install Docker on CentOS offline, we requires some software packages that are available in EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, we have to install EPEL yum repository first.
yum install -y epel-release.noarch
EPEL yum repository has been installed.
Install Docker Yum Repository on CentOS 7
Install Docker CE yum repository on our CentOS 7 operating system.
yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Enable Docker CE (Nightly) yum repository.
yum-config-manager --enable docker-ce-nightly
We have added two yum repositories in our Linux server. Therefore, we should build cache for yum package manager.
yum makecache fast
Amazon eero 6 mesh wifi extender – Add up to 1,500 sq. ft. of Wi-Fi 6 coverage to your existing eero mesh wifi network
$79.99 (as of May 30, 2025 17:33 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Download Docker CE and Software Dependencies
Create a directory to download Docker CE and dependent software packages.
mkdir ~/docker
cd ~/docker
Download Docker CE and dependent packages following Linux command.
yumdownloader --resolve docker-ce
Docker CE and dependent software packages has been downloaded.
ls
Output:
audit-libs-python-2.8.4-4.el7.x86_64.rpm
checkpolicy-2.5-8.el7.x86_64.rpm
containerd.io-1.2.2-3.el7.x86_64.rpm
container-selinux-2.74-1.el7.noarch.rpm
docker-ce-18.09.1-3.el7.x86_64.rpm
docker-ce-cli-18.09.1-3.el7.x86_64.rpm
libcgroup-0.41-20.el7.x86_64.rpm
libseccomp-2.3.1-3.el7.x86_64.rpm
libsemanage-python-2.5-14.el7.x86_64.rpm
policycoreutils-2.5-29.el7_6.1.x86_64.rpm
policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm
python-IPy-0.75-6.el7.noarch.rpm
setools-libs-3.3.8-4.el7.x86_64.rpm
The above packages versions may be different on your Linux server due to the Kernel version that your are using.
Now, we need to transfer these files to docker-offline.example.com. Therefore, we are creating a tarball of all downloaded software packages.
tar czf ~/docker.tar.gz *
Now, we have a tarball of Docker CE and dependent software packages.
ls ~ -lh
Output:
total 58M
-rw-------. 1 root root 1.5K Dec 22 11:29 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4.0K Feb 8 21:32 docker
-rw-r--r--. 1 root root 58M Feb 8 21:39 docker.tar.gz
Install Docker on CentOS Offline
Transfer the docker.tar.gz tarball to docker-offline.example.com and copy at home directory of root user.
ls -lh
Output:
total 58M
-rw-------. 1 root root 1.5K Dec 22 12:23 anaconda-ks.cfg
-rw-r--r--. 1 root root 58M Feb 8 21:39 docker.tar.gz
Extract the docker.tar.gz tarball.
mkdir docker
tar xf docker.tar.gz -C ~/docker
You can now install Docker on CentOS offline by installing all packages from the ~/docker directory.
cd docker
rpm -ivh --replacefiles --replacepkgs *.rpm
Output:
warning: containerd.io-1.2.2-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:policycoreutils-2.5-29.el7_6.1 ################################# [ 8%]
2:libcgroup-0.41-20.el7 ################################# [ 15%]
3:setools-libs-3.3.8-4.el7 ################################# [ 23%]
4:python-IPy-0.75-6.el7 ################################# [ 31%]
5:libsemanage-python-2.5-14.el7 ################################# [ 38%]
6:libseccomp-2.3.1-3.el7 ################################# [ 46%]
7:docker-ce-cli-1:18.09.1-3.el7 ################################# [ 54%]
8:containerd.io-1.2.2-3.el7 ################################# [ 62%]
9:checkpolicy-2.5-8.el7 ################################# [ 69%]
10:audit-libs-python-2.8.4-4.el7 ################################# [ 77%]
11:policycoreutils-python-2.5-29.el7################################# [ 85%]
12:container-selinux-2:2.74-1.el7 ################################# [ 92%]
13:docker-ce-3:18.09.1-3.el7 ################################# [100%]
Start and enable Docker service.
systemctl enable docker.service
systemctl start docker.service
We have successfully installed Docker CE on an offline Linux server.
Download Docker images from Docker Hub
To create containers, we required Docker images, that are available via Docker Hub or a Private Docker Registry server.
Since, our Linux server is not connected to Internet, therefore, we cannot pull Docker images directly from Docker Hub.
The workaround of this problem is to download Docker images on an online system and then transfer and load these images to our offline CentOS 7 server.
Note: You must have Docker CE installed on the online system first. Because we will use the docker command to download and save images from Docker Hub.
docker pull jenkins/jenkins
Output:
Using default tag: latest
latest: Pulling from jenkins/jenkins
8700b2d54fbc: Pull complete
4613d2e35dec: Pull complete
08320da45709: Pull complete
8f947c5bbe77: Pull complete
51cf55002ec2: Pull complete
9537066ae19a: Pull complete
e156275467ac: Pull complete
Digest: sha256:20981c20164347728fca4774b3c45f5d24a73d857e8b9b8e6faf4100cfc0812d
Status: Downloaded newer image for jenkins/jenkins:latest
Similarly, pull more images according to your requirement.
Save Jenkins image in a tar file.
docker save jenkins/jenkins > ~/jenkins.tar
ls -lh
Output:
total 690M
-rw-------. 1 root root 1.5K Dec 22 11:29 anaconda-ks.cfg
-rw-r--r--. 1 root root 690M Feb 12 22:07 jenkins.tar
Transfer jenkins.tar to docker-offline.example.com.
Load jenkins.tar image by using docker command.
docker load < jenkins.tar
Output:
13d5529fd232: Loading layer 105.6MB/105.6MB
abc3250a6c7f: Loading layer 24.07MB/24.07MB
5924ca705d38: Loading layer 9.216kB/9.216kB
852edd42bb1e: Loading layer 4.608kB/4.608kB
03b3a4ed2e5a: Loading layer 3.072kB/3.072kB
37dfb8384dfe: Loading layer 7.168kB/7.168kB
8f65ce1dc902: Loading layer 12.29kB/12.29kB
Loaded image: jenkins/jenkins:latest
Jenkins image has been loaded into Docker. You can use following Linux command to verify this.
docker images
Output:
REPOSITORY TAG IMAGE ID CREATED SIZE
jenkins/jenkins latest 9b74eda1c268 32 hours ago 704MB
Now, we can create and run Docker containers from the Jenkins/Jenkins image.
Frequently Asked Questions (FAQs)
What do I need before installing Docker offline on CentOS?
You’ll need a machine with internet access to download Docker packages and dependencies, a way to transfer them (USB, internal network, etc.), and a CentOS system with the same version/architecture.
Where can I get Docker RPM packages for offline installation?
Download the required Docker RPMs and dependencies from official repositories or trusted mirrors using a machine with internet access, then transfer them to the offline CentOS system.
How do I handle dependencies when installing offline?
Use a tool like yumdownloader
on an online machine to download Docker and all dependencies, then manually install them on the offline system in the correct order.
Can I use Docker without an internet connection after installation?
Yes, once Docker is installed, you can use it offline to manage containers, but you’ll need to manually load any images (via docker load
) since pulling from online registries won’t work.
How do I verify Docker is installed correctly offline?
Run docker --version
to check the installed version, and test basic functionality with docker info
or running a simple pre-loaded container image.
UNIX and Linux System Administration Handbook
$54.39 (as of May 30, 2025 17:35 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Final Thoughts
Installing Docker on CentOS in an offline environment requires careful preparation, including downloading all necessary RPM packages and dependencies in advance. By manually transferring and installing these packages, configuring the Docker daemon, and enabling the service, you’ve successfully set up Docker without internet access.
This method is especially useful for air-gapped or secure environments where online installation isn’t possible. To keep Docker functional and secure, ensure you regularly update packages and maintain system dependencies offline as needed.
Struggling with Linux server management? I offer professional support to ensure your servers are secure, optimized, and always available. Visit my Fiverr profile to learn more!
Ensure a smooth and efficient Docker setup on CentOS with expert support today!
Leave a Reply
You must be logged in to post a comment.