this post was submitted on 26 Jun 2023
35 points (94.9% liked)

Selfhosted

39503 readers
479 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 1 year ago
MODERATORS
 

Hey all,

Just wondering what the consensus is on hosting directly on a computer versus virtualization? Right now I'm hosting my Lemmy instance on a Hetzner VPS, but I would like to eventually migrate to my Linux box at home. It currently runs as a media PC (Ubuntu) in the living room, but I always intended to self-host other software on the side since it should be more than capable of doing both (Ryzen 5600G, 16gb DDR4).

I'm just torn though - should I host a virtual machine on it for Lemmy, or run it directly on Ubuntu as-is? I plan to do some further self-hosting projects as well later down the line.

you are viewing a single comment's thread
view the rest of the comments
[–] callcc 4 points 1 year ago

I'm not sure there is a consensu here, it's a trade off in many dimensions: security, simplicity, performance, independence, ease of management etc.

Bare metal gives you best performance, good simplicity since there are the least moving parts and the least amount of code deployed. It is fairly easy to manage if you know your distro and service well. You might run into trouble if you want to run non packaged software and compile things on your own.

Containers are pretty efficient and simple to use because a lot of software comes pre-packaged (usually including a basic OS, w/o kernel). They are meant to only have one service per container, which can lead to quite some complexity in inter-connecting them. Security wise, they are less well isolated than VMs between each other and to the host. Operating on their persisted state can be very easy and lightweight. One drawback is that people often don't understand whats happening inside (cf. Reproducibility). The saying goes: As with smoothies, you immeadiately know if you like it (a container) but you don't know what's inside.

VMs are slightly less efficient but have a larger management overhead, ie. You need to configure and upgrade each OS (users, firewall rules etc) on its own, on the other hand you gain flexibility by being able to install different distros or having different versions around. You can also more easily manage the state of the machines (backups, snapshots etc). Security wise, VMs are pretty well isolated from each others and the hypervisor, often the configuration of the machines is the weak point (firewall, sshd or other services).