How to Install Docker on Ubuntu 18.04 [Guide for both CE and EE]

Docker has revolutionized the way we develop, package and deploy applications. It allows you to bundle your app along with all its dependencies into a standardized unit called a container. Containers are lightweight, portable, and self-sufficient, making it easier to build, ship and run your applications across different environments.

As a full-stack developer, you may be familiar with Docker already, but did you know that Docker comes in two flavors – Community Edition (CE) and Enterprise Edition (EE)? In this guide, we‘ll dive into the differences between Docker CE and EE, and walk through the steps to install each of them on Ubuntu 18.04. Whether you‘re an individual developer experimenting with containers or part of an enterprise team running mission-critical apps in production, this guide has got you covered. Let‘s get started!

Docker CE vs EE: What‘s the Difference?

Before we jump into the installation, let‘s clarify the key differences between Docker CE and EE:

Docker CE:

  • Free and open source
  • Ideal for individual developers and small teams
  • Includes the core Docker engine and orchestration features
  • Good for learning, experimentation and building container-based apps

Docker EE:

  • Premium, enterprise-grade edition
  • Designed for enterprise development and IT teams
  • Adds advanced features for security, management and support
  • Used to build, ship and run business-critical apps in production at scale
  • Subscription-based pricing starting at $750/month

So which one should you choose? If you‘re just getting started with Docker or building apps for personal projects, Docker CE is the way to go. It‘s free, open source and has all the core features you need.

On the other hand, if you‘re part of an enterprise team developing and deploying apps in production, Docker EE provides additional security, governance and support features needed to run containers at scale. It also comes with official support from Docker and integrates with enterprise systems.

In terms of popularity, let‘s look at Google Trends comparing searches for Docker CE, Docker EE and Docker over time:

Docker CE vs EE vs Docker Trends

As you can see, the general "Docker" term is the most searched by far, followed by "Docker CE". "Docker EE" has much lower search volume. This indicates that most Docker users are either searching for or using the Community Edition. However, Docker EE still has a place for enterprises with more advanced requirements.

Now that you understand the difference, let‘s walk through installing each edition on Ubuntu.

Installing Docker CE on Ubuntu 18.04

We‘ll cover two ways to install Docker CE on Ubuntu:

  1. Using the convenience script from https://get.docker.com
  2. Manually adding the Docker repository and packages

Option 1: Installing Docker CE using the Convenience Script

The easiest way to install the latest Docker CE on Linux is by running the installation script at https://get.docker.com.

First, download and run the script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

The script will detect your Linux distribution and version, then install the appropriate Docker CE package.

Once it completes, verify that Docker is installed correctly by running:

sudo docker run hello-world

You should see a "Hello from Docker!" message, indicating your installation is working.

Note that while this method is convenient for quickly installing Docker, it‘s not ideal for production systems, as it doesn‘t give you control over the package repositories or versions.

Option 2: Installing Docker CE Manually from Repository

For a more controlled installation, you can manually add the official Docker CE repository and install the specific version you need.

First, update your apt package index and install dependencies:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

Next, add Docker‘s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Add the Docker CE apt repository for Ubuntu:

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null  

Finally, update apt and install Docker Engine:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Verify your installation:

sudo docker run hello-world  

This manual installation gives you more control over the versions and lets you verify the authenticity of the packages.

Installing Docker EE on Ubuntu 18.04

Docker EE is the enterprise edition that provides additional features like secure image management, role-based access control, and vulnerability scanning.

Since Mirantis acquired Docker Enterprise in 2019, the way to get started is via the Mirantis Launchpad CLI tool.

Step 1: Download Mirantis Launchpad

Mirantis Launchpad is a CLI tool that automates installing and configuring Docker EE.

Download Launchpad for Linux from the releases page. For example:

wget https://github.com/Mirantis/launchpad/releases/latest/download/launchpad-linux-x64

Make it executable:

chmod +x launchpad-linux-x64
sudo mv launchpad-linux-x64 /usr/local/bin/launchpad

Now test it:

launchpad version

Step 2: Register and Configure

To download the Docker Enterprise container images, you need to register with Mirantis:

launchpad register  

This will prompt you for a username, email and password.

Next, configure a cluster.yaml file specifying the hostnames and IP addresses of your manager and worker nodes. For example:

apiVersion: launchpad.mirantis.com/v1beta3
kind: DockerEnterprise  
metadata:
  name: my-cluster
spec:
  hosts:
    - address: manager1.example.com
      role: manager
    - address: worker1.example.com   
      role: worker
  mcr:
    channel: stable
    installURLLinux: https://get.mirantis.com/
    repoURL: https://repos.mirantis.com
    version: 20.10.7

Step 3: Install Docker Enterprise

With the cluster spec defined, you can now install Docker Enterprise:

launchpad apply  

This will validate the configuration, install Docker EE on each host, and configure the cluster.

Once complete, you can access the cluster admin UI:

INFO[0032] Cluster is now configured. You can access your cluster admin UI at: https://manager1.example.com

Login with your Docker credentials to manage your cluster, access controls, and certified images.

The Mirantis Launchpad makes setting up Docker EE much simpler than manually installing on each host. It automates over 30 steps involved in configuring a production-grade Docker Enterprise environment.

Conclusion

In this guide, we covered how to install both Docker CE and EE on Ubuntu 18.04.

For developers just getting started with Docker, the open source Docker CE provides all the core features to build, run and orchestrate containers. It can be easily installed using the convenience script or by manually adding the apt repository and packages.

For enterprises looking to run containers in production, Docker EE adds advanced security features, image signing, RBAC, and support. Getting started is streamlined with the Mirantis Launchpad CLI tool that automates installation and cluster setup.

Some key takeaways:

  • Use Docker CE for development, learning and experimenting with containers
  • Consider Docker EE for enterprise-grade security, compliance and support
  • The "get.docker.com" script is the easiest way to install latest Docker CE
  • For EE, leverage Mirantis Launchpad to simplify cluster setup and management

I hope this guide helps you navigate the different Docker editions available and walks you through installing them on Ubuntu. Feel free to reach out if you have any questions!

Here are some helpful resources to learn more:

Happy containerizing!

Similar Posts