github.com/eikeon/docker@v1.5.0-rc4/docs/sources/installation/centos.md (about) 1 page_title: Installation on CentOS 2 page_description: Instructions for installing Docker on CentOS 3 page_keywords: Docker, Docker documentation, requirements, linux, centos, epel, docker.io, docker-io 4 5 # CentOS 6 7 While the Docker package is provided by default as part of CentOS-7, 8 it is provided by the EPEL repository for CentOS-6. Please note that 9 this changes the installation instructions slightly between versions. If you 10 need the latest version, you can always use the latest binary which works on 11 kernel 3.8 and above. 12 13 These instructions work for CentOS 6 and later. They will likely work for 14 other binary compatible EL6 distributions such as Scientific Linux, but 15 they haven't been tested. 16 17 Please note that due to the current Docker limitations, Docker is able to 18 run only on the **64 bit** architecture. 19 20 To run Docker, you will need [CentOS6](http://www.centos.org) or higher, 21 with a kernel version 2.6.32-431 or higher as this has specific kernel 22 fixes to allow Docker to run. 23 24 ## Installing Docker - CentOS-7 25 Docker is included by default in the CentOS-Extras repository. To install 26 simply run the following command. 27 28 $ sudo yum install docker 29 30 ## Kernel support 31 32 Currently the CentOS project will only support Docker via the EPEL package when 33 running on kernels shipped by the distribution. There are things like namespace 34 changes which will cause issues if one decides to step outside that box and run 35 non-distro kernel packages. 36 37 ### Manual installation of latest version 38 39 While using a package is the recommended way of installing Docker, 40 the above package might not be the latest version. If you need the latest 41 version, [you can install the binary directly]( 42 https://docs.docker.com/installation/binaries/). 43 44 When installing the binary without a package, you may want 45 to integrate Docker with systemd. For this, simply install the two unit files 46 (service and socket) from [the github 47 repository](https://github.com/docker/docker/tree/master/contrib/init/systemd) 48 to `/etc/systemd/system`. 49 50 ### FirewallD 51 52 CentOS-7 introduced firewalld, which is a wrapper around iptables and can 53 conflict with Docker. 54 55 When `firewalld` is started or restarted it will remove the `DOCKER` chain 56 from iptables, preventing Docker from working properly. 57 58 When using systemd, `firewalld` is started before Docker, but if you 59 start or restart `firewalld` after Docker, you will have to restart the Docker daemon. 60 61 ## Installing Docker - CentOS-6 62 Please note that this for CentOS-6, this package is part of [Extra Packages 63 for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL), a community effort 64 to create and maintain additional packages for the RHEL distribution. 65 66 Firstly, you need to ensure you have the EPEL repository enabled. Please 67 follow the [EPEL installation instructions]( 68 https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F). 69 70 The `docker-io` package provides Docker on EPEL. 71 72 If you already have the (unrelated) `docker` package 73 installed, it will conflict with `docker-io`. 74 There's a [bug report]( 75 https://bugzilla.redhat.com/show_bug.cgi?id=1043676) filed for it. 76 To proceed with `docker-io` installation, please remove `docker` first. 77 78 Next, let's install the `docker-io` package which 79 will install Docker on our host. 80 81 $ sudo yum install docker-io 82 83 ## Using Docker 84 85 Once Docker is installed, you will need to start the docker daemon. 86 87 $ sudo service docker start 88 89 If we want Docker to start at boot, we should also: 90 91 $ sudo chkconfig docker on 92 93 Now let's verify that Docker is working. First we'll need to get the latest 94 `centos` image. 95 96 $ sudo docker pull centos 97 98 Next we'll make sure that we can see the image by running: 99 100 $ sudo docker images centos 101 102 This should generate some output similar to: 103 104 $ sudo docker images centos 105 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 106 centos latest 0b443ba03958 2 hours ago 297.6 MB 107 108 Run a simple bash shell to test the image: 109 110 $ sudo docker run -i -t centos /bin/bash 111 112 If everything is working properly, you'll get a simple bash prompt. Type 113 `exit` to continue. 114 115 ## Custom daemon options 116 117 If you need to add an HTTP Proxy, set a different directory or partition for the 118 Docker runtime files, or make other customizations, read our systemd article to 119 learn how to [customize your systemd Docker daemon options](/articles/systemd/). 120 121 ## Dockerfiles 122 The CentOS Project provides a number of sample Dockerfiles which you may use 123 either as templates or to familiarize yourself with docker. These templates 124 are available on github at [https://github.com/CentOS/CentOS-Dockerfiles]( 125 https://github.com/CentOS/CentOS-Dockerfiles) 126 127 **Done!** You can either continue with the [Docker User 128 Guide](/userguide/) or explore and build on the images yourself. 129 130 ## Issues? 131 132 If you have any issues - please report them directly in the 133 [CentOS bug tracker](http://bugs.centos.org).