How to install the Docker application deployment environment

Docker is an open source application deployment framework. It enables you to deploy applications in their own self-contained environments, providing portability and ease of distribution.

Docker is currently only supported on unmanaged Dedicated Servers.

Installing Docker

The following procedures describe how to install Docker on CentOS 6, CentOS 7, and Ubuntu 14.04.

To view the most up-to-date installation documentation for Docker, please visit http://docs.docker.io.
CentOS 6 and 7

The following procedure describes how to install Docker on an unmanaged Dedicated Server running CentOS 6 or CentOS 7.

If you have not already installed the CentOS operating system template, you must do this before following the procedure below.

To install Docker on CentOS 6 or CentOS 7, follow these steps:

  1. Log in to the server using SSH.
  2. As the root user, type the following commands to update the system:
    yum -y update
    reboot
  3. After the system restarts, log back in to the server using SSH.
  4. To add the EPEL (Extra Packages for Enterprise Linux) repository, type the following command:

    yum -y install epel-release
    
  5. To verify that the EPEL repository has been added, type the following command:

    yum repolist

    You should see in the repository list output a line that resembles the following:

    epel         Extra Packages for Enterprise Linux 6 - x86_64
  6. To install Docker, type the following command:

    yum -y install docker-io
    
  7. To start the Docker service, type the following command:

    service docker start

    If you want the Docker service to start automatically every time the system starts, type the following command:

    chkconfig docker on
  8. To verify that Docker installed correctly, type the following command:

    docker run fedora /bin/echo hello world

    Because this is the first time you are running the Fedora container image, Docker downloads it first, and then runs the command. You should see the following output:

    hello world

    You can also run an interactive shell within the container. To do this, type the following command:

    docker run -i -t fedora /bin/bash

    Note that the command prompt changes to show that you are running an interactive shell in the container. To exit the interactive shell and return to the normal prompt, type exit.

Ubuntu 14.04

The following procedure describes how to install Docker on an unmanaged Dedicated Server running Ubuntu 14.04 (“Trusty Tahr”).

If you have not already installed the Ubuntu 14.04 operating system template, you must do this before following the procedure below.

To install Docker on Ubuntu 14.04, follow these steps:

  1. Log in to the server using SSH.
  2. As the root user, type the following commands to update the system:
    apt-get update
    apt-get upgrade
  3. Type the following command to install the AUFS file system:

    apt-get install linux-image-extra-`uname -r`

    When this command runs, the following message appears:

    A new version of /boot/grub/menu.lst is available, but the version installed
    currently has been locally modified.
    
    What would you like to do about menu.lst?

    Select keep the local version currently installed, and then press Enter.

  4. To add the Docker repository key, type the following command:

    apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    
  5. To add the Docker repository to the APT (Advanced Packaging Tool) sources list, type the following command:

    sh -c "echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list"
    
  6. To install Docker, type the following commands:

    apt-get update
    apt-get install docker-engine
  7. To verify that Docker installed correctly, type the following command:

    docker run ubuntu /bin/echo hello world

    Because this is the first time you are running the Ubuntu container image, Docker downloads it first, and then runs the command. You should see the following output:

    hello world

    You can also run an interactive shell within the container. To do this, type the following command:

    docker run -i -t ubuntu /bin/bash

    Note that the command prompt changes to show that you are running an interactive shell in the container. To exit the interactive shell and return to the normal prompt, type exit.

More Information

For more information about Docker, please visit http://docker.io.

Get Docker Hosting

Article Details

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.