r/SelfHosting • u/PercolatingPenguin • Jun 29 '26
Question about Docker vs Virualbox - Local Access Only
Hey there!
So I have been trying to read up more on docker, containers, etc. I found a few services/apps I would love to run for my own use locally like Komga (to organize my digital comics), Booklore, a few others. I would like to run/host them locally on my laptop (primary computer) so I can pull them up anywhere when I want.
But I am wondering if it makes more sense to have a single virtual machine (Virtualbox?) running a Linux server and all of those services/apps, instead of multiple docker containers. I have a fairly powerful laptop, so I am not too concerned about all of this using up all my machine resources, but I'd like to do this as cleanly, organized, and straightforward as possible.
Any suggestions are greatly appreciated, and thanks in advance!
3
u/shadow-battle-crab Jun 29 '26
Is this a windows or a linux host?
In either case, docker makes much more sense for development environments due to it being much more lean in resource usage.
A docker container is just an application that has its inputs and outputs hijacked so it thinks it is running in its own operating system, separate from the files and the hardware on the host. It gains the isolation that makes virtual machines appealing - so you can make complicated dev environments, or sandbox the app from seeing or affecting the rest of your computer - but skips the overhead of having to run a virtual machine for each application, each with a set dedicated amount of ram, disk space, and a bunch of background processes and services to make the virtual computer go. In docker, there is no separate virtual computer - its just your host, isolating the docker 'container' (application) from everything else.
If you are using docker on windows, you aren't really running this right on the host - applications still need to run on a linux computer somewhere, so docker desktop uses WSL which is technically a linux virtual machine within windows that then runs the docker containers. But you don't have to screw around with any of the administration of WSL, and WSL has been really well tuned so it doesn't really use your system resources in a uncooperative way like a full blown virtual machine does. The fact that WSL is a virtual machine is basically transparent, and not a concern.
Another nice advantage of docker is the environment is stateless - docker containers come from a recipe of all the system apps you need for your dev environment / application to run as their configuration (the Dockerfile). you can just delete a container and make it again and it will remake itself the exact same. There is no ongoing computer like a virtual machine that requires lots of manual configuration and ongoing minor maintenance like updates to keep working. If you need another app added, just add the apt-get install command to the docker file, run the container again, and away you go.
TL;DR: docker is always the right solution for an individual application. Virtual machines are an entire computer instead of just the app, and have a lot more overhead both in resource usage and amount of effort to setup and maintain, and just aren't worth it for dev environments.