Try Vultr Today with $50 Free On Us!Get Started Now
Docker is an application that allows to deploy programs that are run as containers. It was written in the popular Go programming language. This tutorial explains how to install Docker on Ubuntu 14.04.
First off, let's make sure that we are using a clean system. Run the apt updater.
Install Docker on your system. This will add the needed repositories and install the software.
apt-get -y install docker.io ln -sf /usr/bin/docker.io /usr/local/bin/docker sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
If you decide not to run Docker as the root user, you will need to create a non-root user.
adduser user usermod -aG docker user
Restart the Docker service.
service docker.io restart
Run the Docker
hello-world container to test if the installation completed successfully.
docker run hello-world
You will see the following output.
Hello from Docker. This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker Hub account: https://hub.docker.com For more examples and ideas, visit: https://docs.docker.com/userguide/
Lastly, enable Docker to run when your system boots.
update-rc.d docker.io defaults
Congratulations! You have successfully installed Docker. For further reading, see this guide where I explain how to create and use Docker containers.