Docker on Proxmox LXC 🚀 Zero Bloat and Pure Performance!

Sdílet
Vložit
  • čas přidán 22. 05. 2024
  • Running Docker on Proxmox LXC is the best to get maximum performance without unnecessary overheard, all the while, maintaining the much-desired system isolation.
    But if you want security then an Unprivileged LXC is better than a Privileged Proxmox LXC. My home server and media server are both Proxmox LXCs and unprivileged.
    This walkthrough shows you how to install Docker on an unprivileged Proxmox LXC. Knowing this can be very helpful while following my guides and Github repo.
    #proxmox #homelab #minilab #homeserver #plex #docker
    TIMESTAMPS
    0:00 Introduction
    1:03 Proxmox and Proxmox LXC
    2:58 Setting up Ubuntu 22.04 Unprivileged Proxmox LXC
    9:57 Preparing Ubuntu 22.04 Operating System for Docker
    10:20 Create a New Non-Root User
    11:11 System Update
    12:03 Edit SSH Config
    13:24 Installing Basic/Required Packages
    14:20 System Tweaks (sysctl.conf)
    15:05 Enable Firewall (UFW)
    17:30 Automated Setup
    18:22 Docker Setup
    ULTIMATE DOCKER SERVER SERIES:
    Playlist: • Mini Homelab Tour - I ...
    RELEVANT GUIDES:
    🔗 www.smarthomebeginner.com/ult...
    🔗 www.smarthomebeginner.com/doc...
    🔗 www.smarthomebeginner.com/tra...
    AUTO-TRAEFIK
    📰 www.smarthomebeginner.com/go/...
    🎞️ • Auto Traefik 2 - Docke...
    GITHUB REPOSITORIES:
    📜 github.com/htpcbeginner/docke...
    MY PROXMOX HOST:
    🖥️ Topton V700 Intel i7-13800H Mini PC with 64 GB RAM: www.smarthomebeginner.com/go/... (Affiliate Link)
    SUPPORT MY WORK:
    🤝 www.smarthomebeginner.com/go/...
    JOIN THE COMMUNITY:
    👋 www.smarthomebeginner.com/go/...
    🌐 www.smarthomebeginner.com/
    FOLLOW US ON SOCIAL
    Get updates or reach out to Get updates on our Social Media Profiles!
    👥 Twitter: / anandslab
    👥 Facebook: / anandslab
    👥 Instagram: / smarthomebeginr
  • Věda a technologie

Komentáře • 58

  • @AnandsLab
    @AnandsLab  Před měsícem +2

    Some key points based on community feedback:
    1. 7:20 we are specifying the maximum available resources to be used when needed. It does not mean all these resources are blocked.
    2. 12:15 Never port-foward or expose SSH port to the internet.
    3. 13:00 Its obvious but I should have mentioned, SSH with key is the best way to maximize security. Password is not.

  • @RedVelocityTV
    @RedVelocityTV Před 22 dny +7

    Good video but you kept interrupting the screen with your fullscreen video, unneeded disruption when you've already got a webcam on screen

    • @AnandsLab
      @AnandsLab  Před 21 dnem +2

      Thanks! Already being addressed in the newer videos :-)

  • @sl7085
    @sl7085 Před měsícem +1

    Many thanks for this detailed setup video and the guides, really appreciate

  • @reyastaroth
    @reyastaroth Před 18 dny

    Brilliant!! Bravo for your decision to start from scratch the old way!! To follow!!

    • @AnandsLab
      @AnandsLab  Před 17 dny

      Thanks!. Quick question. By "start from scratch the old way", what do you mean exactly?

    • @reyastaroth
      @reyastaroth Před 17 dny

      @@AnandsLab I mean build the stack manually and not the automated Trafik script.
      Trafik auto is good, I tried version 2.0 but it had some errors and I left it. I prefer to have control of the containers and know why things happen.
      In fact, I recently installed Truenas (barmetal) on HP Microserver and I want to mount the plex, sonarr, jacket stack on proxmox (mini pc).
      Downloads on a synology DS218+.
      Your tutorial fits me like a glove.
      Thank you!!!

  • @Felix-ve9hs
    @Felix-ve9hs Před měsícem +14

    12:16 With tools like nmap, it takes an attacker less than one minute to figure out your SSH port, no matter to what you change it to.
    Just disable passwords and use ssh-keys for login.

    • @AnandsLab
      @AnandsLab  Před měsícem +2

      This is the way to go. But majority of the hits I get on my server are on Port 22.

    • @casperghst42
      @casperghst42 Před měsícem +1

      I'd rather say; do not expose ssh to the internet - use VPN.

    • @AnandsLab
      @AnandsLab  Před měsícem

      @@casperghst42 of course. Not sure if I mentioned it. To me it’s obvious but I should be more explicit about it.

    • @Thiccalus
      @Thiccalus Před měsícem +2

      do you know of a decent tutorial to go over implementing ssh keys?

    • @sybren-srb
      @sybren-srb Před 28 dny

      who the hell allows port scanning on his firewall anyway?

  • @jus4027
    @jus4027 Před 13 dny

    very good guide, ty

  • @tuxino
    @tuxino Před 23 dny +1

    I have a small thing you should consider in the future when running multiple commands in sequence.
    When you separate the commands with a semi-colon as in "apt update ; apt upgrade", if something went wrong with the update, it will still try to upgrade. If you look away after pressing enter, you will not notice the error from update, and might think that everything went as planned.
    Instead, consider using double ampersand as in "apt update && apt upgrade". Then, if the first command fails, it will not run the second, and when you look at the screen, the error message from the first is still visible.

    • @AnandsLab
      @AnandsLab  Před 22 dny

      This is a great point. I started out wrong and it became a habit that is hard to break. Thanks for nudge and sharing your point of view.

  • @fourex59
    @fourex59 Před 5 dny

    Anand, thank you for your time in providing this tutorial. I have successfully initiated the docker engine in a container with all of the steps shown in your video. Do I have to create a new container for each docker application that I want to run in Proxmox?

    • @AnandsLab
      @AnandsLab  Před 4 dny

      No. One lxc with docker can run as many containers as you want. In fact my home server lxc runs about 50 docker containers

    • @fourex59
      @fourex59 Před 4 dny

      @@AnandsLab I think you may have misunderstood my question. I was asking if I am limited into running a single docker service or application per container?

    • @RaduRadonys
      @RaduRadonys Před 3 dny

      @@fourex59 What do you mean by "container"? The LXC container or the docker containers inside the LXC container? Your setup should be like this: 1 single LXC container in Proxmox, then install docker in this LXC container, and then install all your docker application on that docker instance.

    • @fourex59
      @fourex59 Před 3 dny

      @@RaduRadonys Ok thanks that answers my question. Should I start off with Portainer as my first application?

    • @RaduRadonys
      @RaduRadonys Před 3 dny

      @@fourex59 Yes you could definitely do that, that's what I'm doing too. And then you could use Portainer to install all remaining apps that you want.

  • @egokhanturk
    @egokhanturk Před měsícem +2

    7:20 you are not allocating cpu cores or memory. You are just giving the limitation. This is advantage of LXC. If im wrong correct me.

    • @AnandsLab
      @AnandsLab  Před měsícem

      Yes, good point. Thanks for clarifying. It is the upper limit. This does not mean all the allocated resources are used.

  • @fbifido2
    @fbifido2 Před 24 dny

    One Question on Debian 12.5:
    - I install the Debian 12 Minimal install
    - I then install docker
    - I created two nginx container, with ports 8080 and 8081 respectively.
    - I then make sure that I can access each container site, plus ping the Debian host.
    - Now I install UFW, allow port 2052/tcp, then enable it.
    - I can still ping the Debian host & also access the two nginx site { WHY ??? }
    My question: How can I block everything and only allow access to ports that I need, like 2052, 8080, 8081/tcp?

    • @AnandsLab
      @AnandsLab  Před 24 dny

      This is a docker problem and one reason why some prefer podman. Docker by default adds firewall rules to allow traffic to all containers. Take a look at ufw-docker on GitHub.

  • @gdr189
    @gdr189 Před měsícem

    How does including LXD alongside LXC change things? I am still having difficulty understanding LXD.

    • @zparihar
      @zparihar Před měsícem +1

      Proxmox is not using LXD. I would ignore it in this case

  • @KryptoJanusz
    @KryptoJanusz Před měsícem +4

    16:00 Why you dont use Proxmox firewall instead?

    • @AnandsLab
      @AnandsLab  Před měsícem +1

      That is definitely an option and offers a firewall outside the system. I tried to showcase something that could work not only for Proxmox LXC but also barebones Ubuntu.

  • @manit77
    @manit77 Před 18 dny

    Try docker swarm. I gave up trying lxc. You may run into issues running HA when clustered.

    • @AnandsLab
      @AnandsLab  Před 17 dny

      Unfortunatley, this is not something I have to tried. My homelabs are simple and have not had the need to have HA until now. May be one day. I will keep this in mind.

    • @ruukes4770
      @ruukes4770 Před 10 dny

      What is HA

    • @RaduRadonys
      @RaduRadonys Před 3 dny

      @@ruukes4770 High Availability.

    • @bouboul3597
      @bouboul3597 Před 3 dny

      @@ruukes4770 high availability. It is an architecture to ensure uptime of a service.

  • @ggoessler
    @ggoessler Před měsícem +1

    I also have it in lxc Containers with zfs in proxmox. It works but Backups are not restorable

    • @AnandsLab
      @AnandsLab  Před měsícem

      What??? I just recently switched to zfs. I have to check the backups then.

    • @firefox7530
      @firefox7530 Před 26 dny

      Well, I cannot even take backups anymore of my docker LXC. The proxmox guys clearly do NOT advise to install docker on proxmox. They are strongly against it as mentioned several time in the proxmox forums on people who have problems with docker on proxmox.

    • @ggoessler
      @ggoessler Před 24 dny

      @@AnandsLab have you also some issues?

  • @ascomp2002
    @ascomp2002 Před měsícem +3

    We are learning of you and you are supposed to be showing us what you are teaching us, please after introduction I think it will be better to leave your face at the corner of the video and leave what you are teaching more on the screen so that we can follow better otherwise I am fighting more to pause to see what you want to show and teach between your face. Just a humble opinion, thank you.

  • @xavierejarque7827
    @xavierejarque7827 Před měsícem +3

    Becareful, ufw does not work with docker containers! You will have all container ports opened to internet.

    • @AnandsLab
      @AnandsLab  Před měsícem

      Yes, this is correct and something to watch out for. Its why UFW-Docker is nice to implement so you can continue to leverage the networking capabilities built into docker while also respective the firewall rules.

    • @fbifido2
      @fbifido2 Před 24 dny +1

      @@AnandsLab I tried UFW-Docker, in 2024 it does not work.
      to protect my containers, i just install UFW in the docker container itself.

    • @fourex59
      @fourex59 Před 5 dny

      @@AnandsLab So does this mean that we should or should not apply the three lines of instruction to create the firewall? I do not want it to be accessible over the Internet. Thanks

  • @harbinjar
    @harbinjar Před 16 dny

    At czcams.com/video/-ZSQdJ62r-Q/video.html Im not receiving these Get statements. All of mine are "Ign" instead of "Get"

    • @AnandsLab
      @AnandsLab  Před 14 dny

      Sorry, I do not understand your comment. Can you explain?

    • @harbinjar
      @harbinjar Před 14 dny

      Nevermind I think my static ip was invalid.

  • @techhoarder3010
    @techhoarder3010 Před 4 dny

    I would not do this, I ran docker in proxmox lxc containers and then a kernel update came out and wiped out all my dockers inside those lxc containers. Its written all over the forums not to run docker in lxc containers yet theres so many new videos on how to do it. 🤦

    • @AnandsLab
      @AnandsLab  Před 3 dny

      This hasn't been my experience. I have been using this setup since Proxmox 6 with no issues. I do not recommend anything in my videos that I haven't be using myself.
      Can you share specifics. The only issue I have heard is very recently (proxmo 8.2???) and this video came out before that. So please elaborate.