In this article, we will have explained the necessary steps to install and configure Docker on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Docker Is container-based application frame, which wraps a specific Program with all its dependencies. Docker containers Can to ship to the location on beginning there without making Entire program installation.
Install Docker on Ubuntu 18.04
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
sudo apt update sudo apt upgrade
Step 2. Install Docker on Ubuntu.
First, add the GPG key for the official Docker repository to the system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge"
You can simply install the Docker CE package using following command:
sudo apt install docker-ce
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
sudo systemctl status docker
The output should be similar to the following, showing that the service is active and running:
● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2019-02-16 12:26:01 UTC; 4s ago Docs: https://docs.docker.com Main PID: 6062 (dockerd) Tasks: 46 CGroup: /system.slice/docker.service ├─6062 /usr/bin/dockerd -H fd:// └─6089 docker-containerd --config /var/run/docker/containerd/containerd.toml
To verify that Docker is installed, run the following command:
Congratulation, you have learned how to install and use Docker Compose on Ubuntu 18.04. If you have any question, please leave a comment below.