• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to install Docker on CentOS 8

June 9, 2020 by Sharad Chhetri Leave a Comment

Docker is a platform software for containers. Initially docker used the LXC and later it has replaced with its own component which is written in Go programming language.

We are installing Docker on CentOS 8. We will club all the required commands and make a simple bash script. This script you can also use with Vagrant,ansible etc.

You can use this bash script many times for installing docker on CentOS 8 / Red Hat 8.

Steps to install docker

1. Create a new bash script file. We are using vi editor for creating the file.

 vi install_docker_centos8.sh

2. Paste the given below content in bash script file, save and exit.

#!/bin/bash
# Description: Install Docker On CentOS 8
# Blog: https://sharadchhetri.com

# disable selinux- permanently and temporarily
sudo sed -i.bak 's/enforcing/disabled/g' /etc/selinux/config 
sudo setenforce 0

# add the docker yum repo
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

# Install docker
sudo dnf -y install docker-ce docker-ce-cli containerd.io --nobest

# Enable the docker service
sudo systemctl enable --now docker

# Add the currently login user in group called 'docker'
sudo usermod -aG docker $USER

# Stop and disable firewalld service
sudo systemctl stop firewalld
sudo systemctl disable firewalld

# logout (you can also do system restart to make docker effectively working)
logout

3. Make the script executable.

sudo chmod +x install_docker_centos8.sh

4. Execute the installation bash script
Note: The script will logout automatically so save and close your applications before running this script.

sh install_docker_centos8.sh

Login back to system and check the docker.

docker --version

Lets test by pulling one docker image.

docker pull httpd

Your installation of docker on CentOS 8 should be completed. This script you can also use this script in Red Hat 8.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Install Docker on CentOS 7
  2. How to install Docker on Ubuntu
  3. How to create Ubuntu docker base image
  4. How to find CentOS Linux release version on CentOS 7 series
  5. Sharing server Migration from CentOS 6 to CentOS 7
  6. How to upgrade to CentOS 6.6 from CentOS 6.x series
  7. Install and configure transparent squid proxy server : RHEL/CentOS 6.x
  8. How to install mod_fcgid on CentOS and RHEL
  9. How to install MySQL Server 5.6 on CentOS 7 / RHEL 7
  10. Install MariaDB Server 10 on CentOS 7 and RHEL 7 by using yum

Filed Under: Linux Tagged With: docker

Reader Interactions

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Linux Commands

How To Get SSH Public Key Fingerprint Information

How to print particular line number by using sed command

How to read logs which are writing continuously : LINUX/UNIX

sed : find the pattern (keyword) and delete the line from file

awk command to search keyword or strings in file

How to show user account password expiration detail on Linux

How to list users above or below particular user id

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

How to convert float to integer number

How to see system load average in terminal with graphical representation

How to encode and decode the strings with base64

Agent admitted failure to sign using the key ssh

AttributeError: ‘WSGIRequest’ object has no attribute ‘session’ Django python web framework

postgres database backup script using database user password inside

This kernel requires an x86-64 CPU but only detected an i686 CPU

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands For Every Beginner

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy