When hosting on my own machine, should I use a virtual machine or not? - eviltoast

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.

  • BrainTheBest5@lemm.ee
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    1 year ago

    If you use a full VM you’ll lose plenty of performance and I don’t think it’ll cope really well with domain names. If you really want to go the “keep everything separated” route use container software, like Docker. It’ll use the same kernel as the host, so no weird networking rerouting/bridging etc… I don’t have any experience with containers, since I run all of my “homelab” bare metal on a Pi, and with this approach I never faced any issues. Containers could be useful if you were running something unorthodox like Gentoo and you need to run software that won’t work on it, even if compiled to run, but it exist as a package on another distro. Then you can just spin up a container for that distro, install the software et voilà, you’re ready to go. AFAIK there shouldn’t be a package for lemmy on any distro, so just clone the source code and compile it, it should be fairly distro-agnostic. Maybe you could compile it in a container to keep your host clean of compile dependencies, but other than that, there’s no real gain. I like to compile stuff, so having a shitload of dependencies already there is pretty handy for me, but for a production system, it’s better to keep it clean.