github.com/fcwu/docker@v1.4.2-0.20150115145920-2a69ca89f0df/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 ### Manual installation of latest version 31 32 While using a package is the recommended way of installing Docker, 33 the above package might not be the latest version. If you need the latest 34 version, [you can install the binary directly]( 35 https://docs.docker.com/installation/binaries/). 36 37 When installing the binary without a package, you may want 38 to integrate Docker with systemd. For this, simply install the two unit files 39 (service and socket) from [the github 40 repository](https://github.com/docker/docker/tree/master/contrib/init/systemd) 41 to `/etc/systemd/system`. 42 43 ### FirewallD 44 45 CentOS-7 introduced firewalld, which is a wrapper around iptables and can 46 conflict with Docker. 47 48 When `firewalld` is started or restarted it will remove the `DOCKER` chain 49 from iptables, preventing Docker from working properly. 50 51 When using systemd, `firewalld` is started before Docker, but if you 52 start or restart `firewalld` after Docker, you will have to restart the Docker daemon. 53 54 ## Installing Docker - CentOS-6 55 Please note that this for CentOS-6, this package is part of [Extra Packages 56 for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL), a community effort 57 to create and maintain additional packages for the RHEL distribution. 58 59 Firstly, you need to ensure you have the EPEL repository enabled. Please 60 follow the [EPEL installation instructions]( 61 https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F). 62 63 The `docker-io` package provides Docker on EPEL. 64 65 If you already have the (unrelated) `docker` package 66 installed, it will conflict with `docker-io`. 67 There's a [bug report]( 68 https://bugzilla.redhat.com/show_bug.cgi?id=1043676) filed for it. 69 To proceed with `docker-io` installation, please remove `docker` first. 70 71 Next, let's install the `docker-io` package which 72 will install Docker on our host. 73 74 $ sudo yum install docker-io 75 76 ## Using Docker 77 78 Once Docker is installed, you will need to start the docker daemon. 79 80 $ sudo service docker start 81 82 If we want Docker to start at boot, we should also: 83 84 $ sudo chkconfig docker on 85 86 Now let's verify that Docker is working. First we'll need to get the latest 87 `centos` image. 88 89 $ sudo docker pull centos 90 91 Next we'll make sure that we can see the image by running: 92 93 $ sudo docker images centos 94 95 This should generate some output similar to: 96 97 $ sudo docker images centos 98 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 99 centos latest 0b443ba03958 2 hours ago 297.6 MB 100 101 Run a simple bash shell to test the image: 102 103 $ sudo docker run -i -t centos /bin/bash 104 105 If everything is working properly, you'll get a simple bash prompt. Type 106 `exit` to continue. 107 108 ## Custom daemon options 109 110 If you need to add an HTTP Proxy, set a different directory or partition for the 111 Docker runtime files, or make other customizations, read our systemd article to 112 learn how to [customize your systemd Docker daemon options](/articles/systemd/). 113 114 ## Dockerfiles 115 The CentOS Project provides a number of sample Dockerfiles which you may use 116 either as templates or to familiarize yourself with docker. These templates 117 are available on github at [https://github.com/CentOS/CentOS-Dockerfiles]( 118 https://github.com/CentOS/CentOS-Dockerfiles) 119 120 **Done!** You can either continue with the [Docker User 121 Guide](/userguide/) or explore and build on the images yourself. 122 123 ## Issues? 124 125 If you have any issues - please report them directly in the 126 [CentOS bug tracker](http://bugs.centos.org).