How to Install Docker on Ubuntu 18.04?

Docker is a container-based tool for creating, deploying, and running applications using containers. Moving the Docker container to a remote location is easy, as you can do it without making any changes to your application. 

Following are the steps to install Docker on Ubuntu 18.04 LTS.

1. You should remove any existing Docker packages, then run the command given below to uninstall them – 

# sudo apt-get purge docker lxc-docker docker-engine

2. To install the required Docker Packages on your system, run this command - 

# sudo apt-get install curl apt-transport-https ca-certificates software-properties-common

3. Now, execute this command – 

# curl -fsSL | sudo apt-key add

It will import Docker's official GPG key to verify the package's signature before installing it with apt-get.

4. Let us install the Docker repository on the Ubuntu system, which includes Docker packages with their dependencies.

# sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

5. Run the update command and install Docker on Ubuntu.

# sudo apt-get update
# sudo apt-get install docker-ce

The Docker service should start automatically.

6. You can verify the status using this command –

# sudo systemctl status docker

Your Docker installation is successful if the service shows as being started.

Get Linux VPS Hosting

Was this answer helpful?

« Back