Learn how to install Docker on Ubuntu Server 18 with our comprehensive guide. Follow step-by-step instructions to set up Docker and start deploying containerized applications efficiently on your server. #centlinux #ubuntu #docker
Table of Contents
What is Docker?
Docker is a set of Platform as a Service (PaaS) products that use operating system level virtualization to deliver software in packages called Containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines. (Courtesy: Wikipedia)
The software that hosts the containers is called Docker Engine. It was initially developed in 2013 and now it is maintained by Docker, Inc.
Docker is a Freemium product and available in both Enterprise (commercial) and Community (free) editions.

Docker Features
Some of the core features of Docker are:
- Easy and Faster Configuration
- Increase productivity
- Application Isolation
- Routing Mesh
- Swarm – A cluster of Docker host machines
- Security Management
- Services
Docker Alternatives
If you’re looking for alternatives to Docker for containerization and orchestration, there are several other tools and platforms available that offer similar functionalities with different features and benefits. Here are some of the best Docker alternatives:
1. Podman
A daemon-less, open-source container engine developed by Red Hat.
Key Features:
- No daemon; runs as a regular user.
- Compatible with Docker CLI commands.
- Strong security features and rootless containers.
Website: Podman Official Website
2. Kubernetes
An open-source container orchestration platform for automating deployment, scaling, and management of containerized applications.
Key Features:
- Automated container deployment and scaling.
- Service discovery and load balancing.
- Self-healing and automated rollouts and rollbacks.
Website: Kubernetes Official Website
3. OpenShift
A Kubernetes-based container orchestration platform developed by Red Hat.
Key Features:
- Enterprise-grade Kubernetes platform.
- Integrated CI/CD pipelines.
- Developer and operational tools for full application lifecycle management.
Website: OpenShift Official Website
4. LXC (Linux Containers)
An operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host.
Key Features:
- Lightweight and minimal overhead.
- Shares the host kernel.
- Suitable for running multiple isolated Linux instances.
Website: LXC Official Website
5. CRI-O
An open-source lightweight container runtime for Kubernetes.
Key Features:
- Built for Kubernetes.
- Supports Open Container Initiative (OCI) standards.
- Lightweight and focused on container orchestration.
Website: CRI-O Official Website
6. rkt (Rocket)
A container engine developed by CoreOS, now maintained by the community.
Key Features:
- Security-focused design.
- Supports multiple container image formats.
- No central daemon; runs containers directly.
Website: rkt Official Website
7. containerd
An industry-standard core container runtime that is a part of the CNCF (Cloud Native Computing Foundation).
Key Features:
- High performance and simplicity.
- Extensible with a clean and stable API.
- Used by Kubernetes and other container platforms.
Website: containerd Official Website
8. Mesos
An open-source project to manage computer clusters.
Key Features:
- Scalable and fault-tolerant resource management.
- Supports container orchestration.
- Integrates with various frameworks like Marathon for container orchestration.
Website: Mesos Official Website
9. Nomad
A flexible, enterprise-grade workload orchestrator developed by HashiCorp.
Key Features:
- Supports containerized, non-containerized, and batch applications.
- Multi-region and multi-cloud support.
- Easy integration with other HashiCorp tools like Consul and Vault.
Website: Nomad Official Website
10. Singularity
A container platform designed for scientific and high-performance computing (HPC) environments.
Key Features:
- Designed for reproducibility and mobility of compute.
- Supports unprivileged (rootless) containers.
- Integrates well with HPC environments and workflows.
Website: Singularity Official Website
Comparing Docker Alternatives
| Tool | Key Features | Suitable For |
|---|---|---|
| Podman | Daemonless, rootless containers, Docker CLI | Development and production |
| Kubernetes | Automated deployment, scaling, management | Large-scale container orchestration |
| OpenShift | Enterprise Kubernetes, CI/CD integration | Enterprise environments |
| LXC | Lightweight, isolated Linux instances | Running multiple Linux systems |
| CRI-O | Kubernetes integration, OCI standards | Kubernetes environments |
| rkt | Security-focused, multiple image formats | Security-focused deployments |
| containerd | High performance, Kubernetes integration | Core container runtime |
| Mesos | Scalable resource management, container orchestration | Cluster management |
| Nomad | Multi-region/cloud support, HashiCorp integration | Mixed workloads and orchestration |
| Singularity | HPC focus, rootless containers | Scientific and HPC environments |
These alternatives offer various features that may better suit specific needs and use cases compared to Docker. Exploring these options can help you choose the best tool for your containerization and orchestration requirements.
Environment Specification
We are using a Ubuntu virtual machine with following specification.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 40 GB
- Operating System – Ubuntu Server LTS 18.04
- Hostname – docker-01.sysadminlabs.com
- IP Address – 192.168.116.216 /24
- Admin User – ahmer
Installing Docker on Ubuntu Server 18.04 requires a 64-bit system with at least 2GB of RAM and a 64-bit CPU supporting hardware virtualization. Sufficient disk space of 10GB or more is recommended to comfortably store Docker images and containers.
For those looking to experiment with Docker or run containerized applications in a reliable environment, using a mini PC or a VPS is highly effective. Hostinger VPS offers a stable Linux platform with dedicated resources, ensuring smooth Docker operation and easy remote management without burdening your local machine.
[Power Your Projects with the Best Mini PC – Shop Now!]
[Get Reliable VPS Hosting at Affordable Prices – Sign Up Now!]
Disclaimer: This post contains affiliate links; using these links supports the blog at no extra cost to you.
Update your Ubuntu Server
Connect with docker-01.sysadminlabs.com as ahmer user by using a ssh tool like PuTTY.
Update existing software packages by executing apt command.
sudo apt updateThere are some package upgrades are available. Install these upgrades by using following command.
sudo apt upgradeInstall Docker on Ubuntu Server
Docker is available in apt repository, therefore, you can easily install it on Ubuntu server by using a single apt command.
sudo apt install docker.ioEnable and start Docker service.
sudo systemctl enable --now dockerVerify version of installed Docker software.
docker --versionOutput:
Docker version 18.09.7, build 2d0083d
Install Docker Compose on Ubuntu Server
Compose (or Docker Compose) is a software tool to define and run multi-container Docker applications. It uses YAML file to create, run and configure application services.
You can install docker-compose on your preferred Linux distro by using the following command.
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeGrant execution permissions to all users on docker-compose executable.
sudo chmod +x /usr/local/bin/docker-composeCreate a soft link to docker-compose command in common binary path, so the command can be accessible from anywhere.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-composeExecute docker-compose command to check its version.
sudo docker-compose --versionOutput:
docker-compose version 1.25.4, build 8d51620a
Docker Compose has been installed successfully on Ubuntu Server 18.04 LTS.
Execute Basic Docker Commands
Search for Alpine Linux in Docker online registry (Docker Hub).
sudo docker search alpineOutput:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
alpine A minimal Docker image based on Alpine Linux⦠6038 [OK]
mhart/alpine-node Minimal Node.js built on Alpine Linux 453
...
roribio16/alpine-sqs Dockerized ElasticMQ server + web UI over Al⦠7 [OK]
cfmanteiga/alpine-bash-curl-jq Docker Alpine image with Bash, curl and jq p⦠5 [OK]
Pull the image of Alpine Linux using docker command.
sudo docker pull alpineOutput:
Using default tag: latest
latest: Pulling from library/alpine
c9b1b535fdd9: Pull complete
Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Status: Downloaded newer image for alpine:latest
List Docker images that are locally available on our Ubuntu 18.04 server.
sudo docker imagesOutput:
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest e7d92cdc71fe 6 days ago 5.59MB
Create a Docker container in interactive mode using Alpine Linux image and execute some test commands on it.
sudo docker run -it --rm alpine /bin/shExecute some commands within Alpine Linux container.
uname -a
cat /etc/os-release
exitOutput:
Linux 40c0683c7989 5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 x86_64 Linux
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
Create a Docker container in detach mode from Alpine Linux image.
sudo docker run -d alpineCheck list of recently executed containers.
sudo docker ps -aOutput:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0ad0a833a2b3 alpine "/bin/sh" About a minute ago Exited (0) About a minute ago mystifying_blackburn
Remove a container as follows.
sudo docker container rm 0ad0a833a2b3Remove an image that is locally available on our Ubuntu 18.04 server.
sudo docker rmi alpineOutput:
Untagged: alpine:latest
Untagged: alpine@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
Deleted: sha256:e7d92cdc71feacf90708cb59182d0df1b911f8ae022d29e8e95d75ca6a99776a
Deleted: sha256:5216338b40a7b96416b8b9858974bbe4acc3096ee60acbc4dfb1ee02aecceb10
You have successfully installed Docker on Ubuntu 18.04 server and executed some basic commands thereon. You should also read our guide on how to install Docker on CentOS 8.
Frequently Asked Questions (FAQs)
1. What are the prerequisites for installing Docker on Ubuntu Server 18?
Before installing Docker, ensure your server is running Ubuntu 18 with a 64-bit architecture and has at least 2GB of RAM. A stable internet connection is also required to download Docker packages.
2. Can I install Docker from the default Ubuntu repositories?
Yes, but the Docker version in the default Ubuntu repositories may be outdated. For the latest stable version, it is recommended to install Docker from the official Docker repository.
3. Do I need root or sudo access to install Docker?
Yes, sudo or root privileges are required to install Docker. Once installed, you can either use sudo with Docker commands or add your user to the Docker group to run them without sudo.
4. How do I verify if Docker is installed and running correctly?
After installation, you can check Docker’s status using a system command. Additionally, running a simple test container helps confirm that Docker is functioning properly.
5. What should I do if Docker fails to start after installation?
If Docker does not start, check for missing dependencies, ensure the Docker service is running, and inspect logs for errors. Reinstalling Docker or restarting the server may also help resolve issues.
Final Thoughts
Installing Docker on Ubuntu Server 18 is a great way to streamline your application deployment and management. With Docker, you can easily create, deploy, and run applications in containers, ensuring consistency across multiple environments.
Your Linux servers deserve expert care! I provide reliable management and optimization services tailored to your needs. Discover how I can help!
If you have any questions or need further support, feel free to reach out!
Recommended Courses
If you’re serious about mastering modern containerization and orchestration, Docker and Kubernetes: The Complete Guide by Stephen Grider is a must-have course. Designed for beginners and professionals alike, it walks you step-by-step through building, deploying, and scaling applications with Docker and Kubernetes—the two most in-demand technologies in DevOps today. With practical projects and expert explanations, this course can fast-track your skills and career growth.
Disclaimer: This link is an affiliate link, and I may earn a small commission at no extra cost to you if you decide to enroll through it.

Leave a Reply
Please log in to post a comment.