this post was submitted on 28 Apr 2025
155 points (95.9% liked)

Selfhosted

46385 readers
743 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
155
What is Docker? (lemmy.world)
submitted 13 hours ago* (last edited 12 hours ago) by Jofus@lemmy.world to c/selfhosted@lemmy.world
 

Hi! Im new to self hosting. Currently i am running a Jellyfin server on an old laptop. I am very curious to host other things in the future like immich or other services. I see a lot of mention of a program called docker.

search this on The internet I am still Not very clear what it does.

Could someone explain this to me like im stupid? What does it do and why would I need it?

Also what are other services that might be interesting to self host in The future?

Many thanks!

EDIT: Wow! thanks for all the detailed and super quick replies! I've been reading all the comments here and am concluding that (even though I am currently running only one service) it might be interesting to start using Docker to run all (future) services seperately on the server!

you are viewing a single comment's thread
view the rest of the comments
[–] grue@lemmy.world 45 points 9 hours ago (5 children)

A program isn't just a program: in order to work properly, the context in which it runs — system libraries, configuration files, other programs it might need to help it such as databases or web servers, etc. — needs to be correct. Getting that stuff figured out well enough that end users can easily get it working on random different Linux distributions with arbitrary other software installed is hard, so developers eventually resorted to getting it working on their one (virtual) machine and then just (virtually) shipping that whole machine.

[–] akilou@sh.itjust.works 1 points 1 hour ago

But why can I "just install a program" on my windows machine or on my phone and it is that easy?

[–] anachrohack@lemmy.world 6 points 8 hours ago (1 children)

Docker is not a virtual machine, it's a fancy wrapper around chroot

[–] possiblylinux127@lemmy.zip 7 points 7 hours ago (2 children)

No, chroot is kind of its own thing

It is just a kernel namespace

[–] fishpen0@lemmy.world 2 points 4 hours ago

Yes, technically chroot and jails are wrappers around kernel namespaces / cgroups and so is docker.

But containers were born in a post chroot era as an attempt at making the same functionality much more user friendly and focused more on bundling cgroups and namespaces into a single superset, where chroot on its own is only namespaces. This is super visible in early docker where you could not individually dial those settings. It’s still a useful way to explain containers in general in the sense that comparing two similar things helps you define both of them.

Also cgroups have evolved alongside containers at this point and work rather differently now compared to 18 years ago when cgroups were invented and this differentiation mattered more than now. We’re at the point where differentiation between VMs and Containers is getting really hard since both more and more often rely on the same kernel features that were developed in recent years on top of cgroups

[–] pupbiru@aussie.zone 1 points 5 hours ago

a chroot is different, but it’s an easy way to get an idea of what docker is:

it also contains all the libraries and binaries that reference each other, such that if you call commands they use the structure of the chroot

this is far more relevant to a basic understanding of what docker does than explaining kernel namespaces. once you have the knowledge of “shipping around applications including dependencies”, then you can delve into isolation and other kinds of virtualisation

[–] AtariDump@lemmy.world 2 points 8 hours ago

Beat me to it.

[–] Scrollone@feddit.it 0 points 9 hours ago* (last edited 3 hours ago) (6 children)

Isn't all of this a complete waste of computer resources?

I've never used Docker but I want to set up a Immich server, and Docker is the only official way to install it. And I'm a bit afraid.

Edit: thanks for downvoting an honest question. Wtf.

The main "wasted" resources here is storage space and maybe a bit of RAM, actual runtime overhead is very limited. It turns out, storage and RAM are some of the cheapest resources on a machine, and you probably won't notice the extra storage or RAM usage.

VMs are heavy, Docker containers are very light. You get most of the benefits of a VM with containers, without paying as high of a resource cost.

[–] possiblylinux127@lemmy.zip 9 points 7 hours ago

Docker has very little overhead

[–] EncryptKeeper@lemmy.world 17 points 8 hours ago* (last edited 8 hours ago)

If it were actual VMs, it would be a huge waste of resources. That’s really the purpose of containers. It’s functionally similar to running a separate VM specific to every application, except you’re not actually virtualizing an entire system like you are with a VM. Containers are actually very lightweight. So much so, that if you have 10 apps that all require database backends, it’s common practice to just run 10 separate database containers.

[–] dustyData@lemmy.world 11 points 8 hours ago

On the contrary. It relies on the premise of segregating binaries, config and data. But since it is only running one app, then it is a bare minimum version of it. Most containers systems include elements that also deduplicate common required binaries. So, the containers are usually very small and efficient. While a traditional system's libraries could balloon to dozens of gigabytes, pieces of which are only used at a time by different software. Containers can be made headless and barebones very easily. Cutting the fat, and leaving only the most essential libraries. Fitting in very tiny and underpowered hardware applications without losing functionality or performance.

Don't be afraid of it, it's like Lego but for software.

[–] anachrohack@lemmy.world 5 points 8 hours ago

No because docker is not actually a VM

[–] couch1potato@lemmy.dbzer0.com 4 points 8 hours ago (1 children)

I've had immich running in a VM as a snap distribution for almost a year now and the experience has been leaps and bounds easier than maintaining my own immich docker container. There have been so many breaking changes over the few years I've used it that it was just a headache. This snap version has been 100% hands off "it just works".

https://snapcraft.io/immich-distribution

[–] AtariDump@lemmy.world 1 points 8 hours ago (2 children)

Interesting idea (snap over docker).

I wonder, does using snap still give you the benefit of not having to maintain specific versions of 3rd party software?

[–] Colloidal@programming.dev 2 points 6 hours ago (1 children)

Snap is like Flatpak. So it will store and maintain as many versions of dependencies as your applications need. So it gives you that benefit by automating the work for you. The multiple versions still exist if your apps depend in different versions.

[–] AtariDump@lemmy.world 1 points 2 hours ago

Thanks.

Now to see if there’s a flatpack because fuck snap.

[–] couch1potato@lemmy.dbzer0.com 4 points 7 hours ago

I don't know too much about snap (I literally haven't had to touch my immich setup) but as far as I remember when I set it up that was snap's whole thing - it maintains and updates itself with minimal administrative oversight.