Hello, have setup my proxmox server since some weeks recently I found that LXC containers could be useful as it really separate all my services in differents containers. Since then I figured out to move my docker’s services from a vm into several LXC containers. I ran into some issues, the first one is that a lot of projects run smoother in docker and doesn’t really have a “normal” way of being package… The second thing is related to the first one, since they are not really well implemented into the OS how can I make the updates?
So I wonder how people are deploying their stuffs on LXC proxmox’s containers?
Thanks for your help!
EDIT : Tried to install docker upon debian LXC but the performances were absolutely terrible…
Check out Helper Scripts. These make getting LXCs up and running super easy. This was built by a community member who recently passed away and he turned it over to the community before his passing. Its a great project!
I’ve seen this project and it’s really impressive and useful!
I’m not going to use the scripts directly but write mine mainly to learn bash and how to deploy services (without docker…), but I will 100% read and try to understand the scripts to mimic them on my one.
Rest in peace Tteck thank you for all your work ❤️
In general, I prefer unprivileged LXC to a full VM unless there’s some specific requirement that countermands that preference (like running an appliance or a non-Linux OS).
What I tend to do is create a new container for each service (unless there’s a related stack). If the service runs on Docker, I’ll install that right inside the container and manage it with
docker compose
. By installing Docker directly from get.docker.com instead of the built in packages, it pretty much works all the time.Since each service is in its own container, restoring backups is pretty service-specific. If you wanted some kind of central control plane for docker, you could check out swarm mode.
I tried to install docker with the get.docker link but the same results occurs I got really bad performance… So I wonder how to self host stuffs when using LXC containers and install services the old school way
That will be totally doable, but there’s no one way to setup every service. Some you’ll install from the repository (like nginx or HAProxy or samba). Others you’d have to clone from git (like netbox or dokuwiki). Others have entirely different methods. So, unfortunately it’ll be a lot of reading the documentation.
Lastly there is podman that some people love for container management. It’s not my cup of tea, but it might fit you.
Install on a vm though, not lxc
Humm Im going to check it, but do you think that it would be a good option to deploy all my services to lxc even if their primary release channel is docker?
That depend on how much work you have to do to keep it working.
Let’s take a fairly common webserver like Caddy. Now you can install this through docker, or natively on linux.
If the app only exists as docker image then it cones down to your ability or recreating what the dockerfile does to get it installed on your lxc container.
Fun fact: early editions of docker used lxc for its containers.
So I would have to write some scripts for installing and maintaining my installs?
(I didn’t know about your “fun fact” :) thx)
Depends on what you’d want. A dockerfile defines how the image is built. If you want to mimic this then you need scripts.
But I think you could benefit from learning how docker works from the ground up if you want to recreate docker inages in lxc.
Better use is a dedicated docker host (a vm) and run your non-docker on lxc. Treat lxc as a minimal vm for one ( or a few) services/apps per lxcontainer
I wanted to use containers to have good maintained and isolated stuff, so I think I’m going to use scripts to install and update all my stuff 😁
I prefer VMs as I have found that LXC containers are buggy and slow.
you can but from my experience containers are lightweight and useful
I just create the lxc, and if the package requires docker I begrugendly install docker on the lxc, I’ve never had performance issues with Debian lxc, I use it as my base template and it runs flawlessly (outside of ping not working unless sudo)
That being said, I don’t like installing Docker a billion times and I feel like that defeats the purpose of using an lxc in the first place, so for most small Docker containers I just put them on the same lxc since docker is going to handle all the isolation in those anyway
I don’t ZFS though I still use normal EXT4, and I use PBS for backing it up to an external drive, but I’m curious if that may be the root cause of the issues.
Your problem with docker in LXC might be if you’re using ZFS for your host storage, IIRC you need to install fuse-overlayfs on host and LXC that will be running docker. It works fine for me that way. I’m not sure if that requirement has changed recently, when I did it, the host was under PM 7.X and Debian 11 LXC.
zfs overlay / docker snapshot issue has been solved since 2021. Proxmox is also well into 8.3, 8.0 has been stable since early 2023.
Yah, its been a while since I set that up apparently.