What is Docker, why is it suddenly getting so popular, and how does docker compare to VirtualBox or VMware? Don't worry we will try to explain all of these in simple terms. We have published extensively on using VirtualBox to build a home server. With docker gaining in popularity, we thought it would be good to compare docker vs VirtualBox, more generally speaking containerization vs virtualization, for home server and HTPC users. We will see what's the best tool to run sever apps and services. [Read: Ultimate Smart Home Media Server 2018 in minutes with Docker and Ubuntu – Basic]
Table of Contents
- What is Docker?
- Docker vs VirtualBox or other VM software
- What is a Docker Container?
- What is Docker Hub or Docker Store?
- Why should I use Docker for Home Server and HTPC apps?
What is Docker?
Docker is an operating-system-level virtualization project developed by Docker, Inc. Docker was first released in 2013 being compatible with Unix operating systems. However today, Docker also comes bundled with Windows Server 2016. Docker is also available for Windows and Mac.
It allows users to install applications inside software containers. What this means is that applications can be separated/isolated from the operating system on which the are running. In Docker containers each application is self-contained, therefore setup and removal is easy and has little to no effect on the operating system. With several HTPC and home server apps are already available for easy installation as Docker containers, this might be the new way to setup your home server quickly.
Docker vs VirtualBox or other VM software
Containerization vs Virtualization
In essence this is comparison of different technologies: containerization vs virtualization. VirtualBox and VMWare are virtualization apps that create virtual machines that are isolated at the hardware level. Docker is a containerization app that isolates apps at software level. If a VM is a house then a docker container is a hotel room. If you don't like the setup, changing a hotel room is much easier than changing a house. A hotel has multiple rooms sharing the same underlying infrastructure (foundation, plumbing, electrical wires, etc.). Similarly, Docker offers the ability to run multiple applications within the same host OS, sharing underlying resources (CPU, RAM, etc.).
Some like to boast that Docker is better than VirtualBox. But we need to understand that while having a lot of functionality and being more efficient in running apps, Docker can't replace virtual machines. Table below is a basic comparison of Docker vs Virtual Machines.
Virtual Machines vs Docker: Summary of basic differences
|Virtual Machines||Docker Containers|
|Hardware level process isolation||OS level process isolation|
|VMs offer complete isolation of applications from host OS||Docker containers can share some resources with host OS|
|Each VM has separate OS||Each docker container can share OS resources|
|Boots in minutes||Boots in seconds|
|More resource usage||Less resource usage|
|Pre-configured VMs are hard to find and manage||Pre-built docker containers for home server apps already available|
|Customizing pre-configured VMs requires work||Building a custom setup with containers is easy|
|VMs are typically bigger in size as they contain whole OS underneath||Docker containers are small in size with only docker engine over the host OS|
|VMs can be easily moved to a new host OS||Containers are destroyed and recreated rather than moving (data volume is backed up)|
|Creating VMs take relatively long time||Dockers can be created in seconds|
|Virtualized Apps are harder to find and it takes more time to install and run them||Containerized apps such as SickBeard, Sonarr, CouchPotato etc. can be found and installed easily within minutes|
Docker contains apps; VMs contain OSes
Docker is really good specifically for running individual apps in a modular way. Virtual machines vs containers, have a lot more functionality because a VM allows you to install a complete operating system while in Docker you don't have the full functionality of an operating system. Of course, it is important to choose the right tool for the job, so it is recommended to use Docker for running your HTPC services and use VirtualBox for running operating systems. [Read: How to run a Ubuntu home server on VirtualBox VM?]
In summary, Containers vs Virtual Machines (VM), avoids the overhead of multiple and separate VMs. This means that instead of having multiple VMs all running the same Linux operating system with a single app installed, you can have only one instance of Docker with a single base image, and multiple containers on top. This also reduces hardware resource requirements significantly, while providing some level of application isolation. We can conclude that when comparing Docker vs VirtualBox or other Virtual Machine software, Docker is better for running apps and services in containers because it's a faster and easier way to do it.
What is a Docker Container?
Now that you know what is Docker, let's move on and try to understand containers. A Docker container can be described as a wrap around a piece of software that contains everything needed in order to run the software. This is done in order to make sure that the app will run the same no matter what environment it runs in.
In Docker, apps like SickRage, CouchPotato, Plex, and other HTPC tools can be installed with ease, each running in their own container. You can either build your own Docker containers with services, or you can download ready-to-run containers from the Docker Hub.
What is Docker Hub or Docker Store?
Docker Hub or Store is a cloud-based service which allows you to push and pull official images or from the community. For the average user, Docker Hub can be seen as a "safe container store" or an "app store" where you go to grab your apps and run them in Docker containers. You can visit Docker Store to search for and download any containers or containerized apps that you are interested in.
Why should I use Docker for Home Server and HTPC apps?
Docker offers a great deal of independence for apps, by running them in containers that can be installed and managed independently. For example, a container can be installed on a Docker instance in Windows or Linux, without the need of installing prerequisites in advance, or having to worry about incompatibilities. Most well-known apps are already containerized so installing and running docker containers with various apps is easier than installing them the old fashioned way. You will be able to add/remove services on your server without breaking your current setup. Docker is now the preferred way to run applications in a safe and efficient way on your server. If you already work in IT, Docker will probably make your life easier and it's worth learning how to use it.
If you are excited about Docker and want to learn more about it, then stay tuned. We have several articles coming soon on efficiently setting up and managing home server apps using Docker. Hopefully, this article clarified what is docker and differentiated docker vs VirtualBox.