Docker on Proxmox LXC 🚀 Zero Bloat and Pure Performance!

Поделиться
HTML-код
  • Опубликовано: 19 июн 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
  • НаукаНаука

Комментарии • 66

  • @AnandsLab
    @AnandsLab  Месяц назад +4

    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.

  • @tuxino
    @tuxino Месяц назад +6

    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  Месяц назад +2

      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.

  • @sl7085
    @sl7085 2 месяца назад +1

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

    • @AnandsLab
      @AnandsLab  2 месяца назад

      Glad you enjoyed it!

  • @Felix-ve9hs
    @Felix-ve9hs 2 месяца назад +17

    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  Месяц назад +2

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

    • @casperghst42
      @casperghst42 Месяц назад +1

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

    • @AnandsLab
      @AnandsLab  Месяц назад

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

    • @Thiccalus
      @Thiccalus Месяц назад +2

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

    • @sybren-srb
      @sybren-srb Месяц назад

      who the hell allows port scanning on his firewall anyway?

  • @reyastaroth
    @reyastaroth Месяц назад

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

    • @AnandsLab
      @AnandsLab  Месяц назад

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

    • @reyastaroth
      @reyastaroth Месяц назад

      @@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!!!

  • @RedVelocityTV
    @RedVelocityTV Месяц назад +10

    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  Месяц назад +4

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

    • @avertry9529
      @avertry9529 19 дней назад

      That's why I hate Tiktok, you don't need to see the person talking and hand talking videos, are the worst. Rant over, I finally got it out.

  • @murlock666
    @murlock666 15 дней назад

    Many thanks Anand I'm pretty new to all this and up til now ive had docker running via a casaOS VM. I will be ditching that now and going forward with a Docker LXC for the future :)

    • @AnandsLab
      @AnandsLab  15 дней назад

      Great. CasaOS is great. But building from scratch and learning is the fun part.

  • @jus4027
    @jus4027 Месяц назад

    very good guide, ty

  • @fourex59
    @fourex59 Месяц назад +1

    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  Месяц назад

      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 Месяц назад

      @@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 Месяц назад +1

      @@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 Месяц назад

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

    • @RaduRadonys
      @RaduRadonys Месяц назад +1

      @@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.

  • @fbifido2
    @fbifido2 Месяц назад

    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  Месяц назад +1

      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.

  • @user-bq2xt5ws1d
    @user-bq2xt5ws1d 15 дней назад

    I’m planning my first Proxmox install and plan on using Docker.
    Tteck has a number of helper scripts, including a direct install of a Docker LXC without loading Ubuntu first. If I’m only going to use the LXC for Docker, is there any reason to have it nested in Ubuntu first?
    Thanks!

    • @AnandsLab
      @AnandsLab  15 дней назад

      Although i am familiar with Tteck's scripts, I am not familiar with his/her Docker LXC. I assume it also use Ubuntu/Debian as a base inside the LXC anyway and is nested. I try to run it and do a quick check.

  • @egokhanturk
    @egokhanturk 2 месяца назад +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  Месяц назад

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

  • @gdr189
    @gdr189 Месяц назад

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

    • @zparihar
      @zparihar Месяц назад +1

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

  • @KryptoJanusz
    @KryptoJanusz 2 месяца назад +4

    16:00 Why you dont use Proxmox firewall instead?

    • @AnandsLab
      @AnandsLab  2 месяца назад +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.

  • @ggoessler
    @ggoessler 2 месяца назад +1

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

    • @AnandsLab
      @AnandsLab  2 месяца назад

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

    • @firefox7530
      @firefox7530 Месяц назад

      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 Месяц назад

      @@AnandsLab have you also some issues?

    • @Jarek.
      @Jarek. 20 дней назад

      What does it mean "not restorable"? I've restored a VM last week, Proxmox 8.2.2 on ZFS.

  • @manit77
    @manit77 Месяц назад

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

    • @AnandsLab
      @AnandsLab  Месяц назад

      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 Месяц назад

      What is HA

    • @RaduRadonys
      @RaduRadonys Месяц назад

      @@ruukes4770 High Availability.

    • @bouboul3597
      @bouboul3597 Месяц назад

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

    • @iuhere
      @iuhere 23 дня назад

      ​@@ruukes4770my guess would be home assistant. it is a way to aggregate different smart devices to one place .

  • @techhoarder3010
    @techhoarder3010 Месяц назад +4

    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  Месяц назад +1

      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.

    • @WHAT-GRINDS-MY-GEARS
      @WHAT-GRINDS-MY-GEARS 5 дней назад

      Glad someone said it.

  • @xavierejarque7827
    @xavierejarque7827 2 месяца назад +4

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

    • @AnandsLab
      @AnandsLab  Месяц назад

      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 Месяц назад +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 Месяц назад

      @@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

  • @ascomp2002
    @ascomp2002 Месяц назад +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.

  • @harbinjar
    @harbinjar Месяц назад

    At ruclips.net/video/-ZSQdJ62r-Q/видео.html Im not receiving these Get statements. All of mine are "Ign" instead of "Get"

    • @AnandsLab
      @AnandsLab  Месяц назад

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

    • @harbinjar
      @harbinjar Месяц назад

      Nevermind I think my static ip was invalid.