Docker on Proxmox LXC 🚀 Zero Bloat and Pure Performance!

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 119

  • @AnandsLab
    @AnandsLab  7 місяців тому +9

    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.

  • @fabolt
    @fabolt 3 місяці тому +9

    Never use swap for lxc container if possible. It can make leak data from the container through the host to other containers

  • @tuxino
    @tuxino 7 місяців тому +17

    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  7 місяців тому +5

      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.

  • @varunaeeriyaulla
    @varunaeeriyaulla 3 місяці тому +3

    I use Debian instead of Ubuntu for LXCs. Even docker runs on Debian out-of-the box without any modifications. Yes, on unprivileged mode.

  • @Felix-ve9hs
    @Felix-ve9hs 7 місяців тому +23

    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  7 місяців тому +3

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

    • @casperghst42
      @casperghst42 7 місяців тому +1

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

    • @AnandsLab
      @AnandsLab  7 місяців тому

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

    • @Thiccalus
      @Thiccalus 7 місяців тому +2

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

    • @sybren-srb
      @sybren-srb 7 місяців тому

      who the hell allows port scanning on his firewall anyway?

  • @FizzGiGG55123
    @FizzGiGG55123 4 місяці тому +2

    I'm already subscribing at 2:49 after you started talking about privileged and unprivileged. I am roughly 12 hours into trying out Proxmox and have not learned a ton yet, so I'm very impressionable. :P Every other video I found on YT, so far, that was talking about initial setups and how to do blah blah blah just had you untick the "Unprivileged container" box. It didn't feel right to me, for obvious reasons. It felt lazy, but maybe that was how it was done in this new ecosystem. I didn't know. So, thank you for staying security minded, I'll be checking out your other vids!!

  • @gjermundification
    @gjermundification 3 місяці тому +3

    There is a separate linux distro for the purpose of kubernetes / docker called: Talos.

    • @pg_usa
      @pg_usa Місяць тому

      You Right... This video show me people don't understand what they do! Wasting resources and our time!

  • @murlock666
    @murlock666 5 місяців тому +1

    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  5 місяців тому

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

  • @reyastaroth
    @reyastaroth 6 місяців тому +1

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

    • @AnandsLab
      @AnandsLab  6 місяців тому

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

    • @reyastaroth
      @reyastaroth 6 місяців тому

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

  • @fracturefixed
    @fracturefixed 2 дні тому

    such a good explanation... new follower.

  • @RedVelocityTV
    @RedVelocityTV 6 місяців тому +18

    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  6 місяців тому +4

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

    • @avertry9529
      @avertry9529 5 місяців тому

      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.

  • @RichardMcDonald-k6r
    @RichardMcDonald-k6r 2 місяці тому

    Hey I like your setup and if you could do a video on how you got it all setup from start to finish would be awesome. I'm currently trying to do a server for my Omada controller and I just can't seem to get it working. I using an old laptop with Ubuntu now but it seems nothing is working, but what I'm watching what you are doing and I'm am amazed.

  • @fbifido2
    @fbifido2 7 місяців тому +1

    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  7 місяців тому +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.

  • @fourex59
    @fourex59 6 місяців тому +2

    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  6 місяців тому +1

      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 6 місяців тому

      @@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 6 місяців тому +2

      @@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 6 місяців тому

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

    • @RaduRadonys
      @RaduRadonys 6 місяців тому +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.

  • @uSlackr
    @uSlackr Місяць тому

    Rather than set a static IP, I use a DHCP reservation. That way all of the IP are documented in the dhcp config making the config discoverable.

  • @AndresFranco-PT
    @AndresFranco-PT Місяць тому

    Hi Anand, I have a question regarding the use of unprivileged LXC container in Proxmox and wanting to have container apps accessing a shared folder via CIFS or NFS to backup data or database. How do you do it? don't you face any issues? I normally run portainer and found is not possible to add external remote volume using CIFS. Then mapping through proxmox node seems to work but not for each situation and permissions can be tricky when using that method. Could you please provide your comments or share your experience on this? Thank you in advance and great video and guides in your website.

  • @egokhanturk
    @egokhanturk 7 місяців тому +4

    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  7 місяців тому +3

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

  • @jims888
    @jims888 4 місяці тому

    I know this has been a debate for some time, but for today, Is it a good idea to run Docker on a lot of Proxmox LXCs?
    Also please make a video on how to SSH with key, if you would. Thanks!

  • @sl7085
    @sl7085 7 місяців тому +2

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

    • @AnandsLab
      @AnandsLab  7 місяців тому

      Glad you enjoyed it!

  • @rag7628
    @rag7628 22 дні тому

    Hi thanks for your great and professional tutorials..
    Just one question what is the "my Home Server" for, you are talking about here 9:10 ?

    • @AnandsLab
      @AnandsLab  16 днів тому +1

      My home server is the "hs" container on proxmox. It is my home server that is running all apps including the Arr apps. Then i have a separate mds container that is media and database server.

    • @rag7628
      @rag7628 15 днів тому

      @@AnandsLab Thanks.. 👍

  • @MotownBatman
    @MotownBatman 4 місяці тому +1

    New Sub; Detroit, Michigan, US
    Well Done Sir, Im working on Setting up ProxMox...Again, and getting to actually work and do seomthign this time lol
    Keep It Up!

    • @AnandsLab
      @AnandsLab  4 місяці тому +1

      Uh the state up north 🤮. lol! Thanks for joining. Go bucks!

    • @MotownBatman
      @MotownBatman 4 місяці тому

      @@AnandsLab Thanks for Taking Toledo 🤣🔫

  • @KryptoJanusz
    @KryptoJanusz 7 місяців тому +6

    16:00 Why you dont use Proxmox firewall instead?

    • @AnandsLab
      @AnandsLab  7 місяців тому +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.

  • @techhoarder3010
    @techhoarder3010 6 місяців тому +15

    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  6 місяців тому +4

      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.

    • @G-3-A-R-Z
      @G-3-A-R-Z 5 місяців тому +1

      Glad someone said it.

    • @MikeDeVincentis
      @MikeDeVincentis 4 місяці тому +3

      There have been issues in the past with AppArmor getting in the way of docker containers starting when in an LXC. Yeah, docker is cool and you can run a lot of them under one LXC instance, but you also have to consider the backup and restore scenario if anything ever goes wrong with one of the apps. If everything is under 1 LXC, you must restore everything back to the latest backup in the event of a failure. In some situations this is ok, for instance I run all my arrs apps in 1 LXC and run a nightly backup, but I have other LXC instances for everything else so I can have a separate backup plan for each. This way, if something fails, I don't have to keep track of all the changes I'd have to make to each app if I did a restore.

  • @gjermundification
    @gjermundification 3 місяці тому

    How does docker in proxmox compare to running docker pods in kubernetes?

    • @AnandsLab
      @AnandsLab  2 місяці тому

      This is beyond my experience. I do not use Kubernetes, at least yet. May be others can chime in.

  • @ggoessler
    @ggoessler 7 місяців тому +3

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

    • @AnandsLab
      @AnandsLab  7 місяців тому

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

    • @firefox7530
      @firefox7530 7 місяців тому

      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 7 місяців тому

      @@AnandsLab have you also some issues?

    • @Jarek.
      @Jarek. 5 місяців тому

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

  • @B_r_u_c_e
    @B_r_u_c_e Місяць тому +1

    Thank you.

  • @uSlackr
    @uSlackr Місяць тому +1

    well done!

  • @ElNadaInLada
    @ElNadaInLada 22 дні тому

    You have to tweak UFW-rules seperately so that it works for Docker.
    It is one of the biggest mistake people make in regards with working with Docker.
    Countless services open on the internet that shouldn't be.
    Docker opens ports up by itself without asking and ufw doesn't work in default way for this.
    You can explicitely close a port or everything down with UFW and Docker will overrule it.

  • @REALTALKEUGENELANE
    @REALTALKEUGENELANE 3 місяці тому +2

    thank you

  • @jus4027
    @jus4027 6 місяців тому +1

    very good guide, ty

  • @LaneRiddell
    @LaneRiddell 5 місяців тому

    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  5 місяців тому +1

      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.

  • @RayZde
    @RayZde 6 місяців тому

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

    • @AnandsLab
      @AnandsLab  6 місяців тому

      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 6 місяців тому

      What is HA

    • @RaduRadonys
      @RaduRadonys 6 місяців тому

      @@ruukes4770 High Availability.

    • @bouboul3597
      @bouboul3597 6 місяців тому

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

    • @iuhere
      @iuhere 6 місяців тому

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

  • @gdr189
    @gdr189 7 місяців тому

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

    • @zparihar
      @zparihar 7 місяців тому +1

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

  • @xavierejarque7827
    @xavierejarque7827 7 місяців тому +5

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

    • @AnandsLab
      @AnandsLab  7 місяців тому

      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 7 місяців тому +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 6 місяців тому

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

  • @133col
    @133col Місяць тому +1

    Use Alpine for minimum footprint

  • @ronhey1709
    @ronhey1709 2 дні тому

    Thanks

  • @ascomp2002
    @ascomp2002 7 місяців тому +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.

    • @AnandsLab
      @AnandsLab  7 місяців тому

      Feedback noted🙂

  • @danbrown586
    @danbrown586 Місяць тому

    If this LXC is only exposed to your LAN, why are you changing the SSH port (and if you're taking that step, why not disable password logins)? And enabling the firewall? Particularly since Docker clobbers the firewall rules anyway? These just seem like pointless complications.

    • @AnandsLab
      @AnandsLab  Місяць тому

      A lot can be done. Just a simple obfuscation. All of what you mentioned are good practices.

  • @emranzafar
    @emranzafar 4 місяці тому

    good video but one suggestion, please keep the focus on the computer screen or the picture you are showing. We can see you, picture in picture of the video anyways.

    • @AnandsLab
      @AnandsLab  4 місяці тому

      Thanks. Already addressed. I was starting out then. My recent videos should be easier on the eye :-)

  • @DevelopmentMyTechLab
    @DevelopmentMyTechLab Місяць тому

    Where are my sunglasses! OMG my eyes, please but it in dark mode :p

    • @AnandsLab
      @AnandsLab  Місяць тому

      LOL switched to immediately :-)

  • @Damia-cz8og
    @Damia-cz8og 4 місяці тому

    @AnandsLab RHEL yes install desktop not proxmox yes terminal install alll desktop apps docker yeah or not

  • @kuromimiGunnerGirl
    @kuromimiGunnerGirl 23 дні тому

    would be great if you stay at that small ovelay, and show more of your screen. Yes you are handsome, but i prefer to see the screen slightly longer to follow :D:D:D thanks btw

    • @AnandsLab
      @AnandsLab  22 дні тому

      lol. I was starting out. A lot has changed since.

  • @harbinjar
    @harbinjar 6 місяців тому

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

    • @AnandsLab
      @AnandsLab  6 місяців тому

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

    • @harbinjar
      @harbinjar 6 місяців тому

      Nevermind I think my static ip was invalid.

  • @MilaDeliada
    @MilaDeliada Місяць тому

    I think best virtual in proxmox use vm not lxc

    • @AnandsLab
      @AnandsLab  Місяць тому

      This depends on need. LXC works great for many reasons.

  • @_AndydnA_
    @_AndydnA_ 5 місяців тому

    Thanks for the video, but I’m afraid I have to disagree with your vision. To use Docker on top of an LXC container, privileged or unprivileged, is nonsense. Docker can run perfectly containers on top of a VM. Do you want a container? Use LXC directly and forget Docker. You are also ignoring fundamental knowledge such as DNS, FQDN, PVE firewall, ecc.

    • @AnandsLab
      @AnandsLab  4 місяці тому

      To each their own. I would not call Docker on LXC a nonsense. It works great and offers some great advantages over a VM. I have had only 1 issue over the last 2 years that too was a issue on Docker side and not proxmox.

  • @mohsenfazzani8770
    @mohsenfazzani8770 3 місяці тому

    It is better to let us see your screen than to see your face. To put your face on the screen when speaking

    • @AnandsLab
      @AnandsLab  2 місяці тому

      Of course, I was new youtube. I have evolved my methods over time.

  • @MaYHeM-x8k
    @MaYHeM-x8k 4 місяці тому +1

    Holy crap, the cuts. Cut after cut after cut. It's like you can't string two sentences together, so you have to cut EVERY SENTENCE. It's jarring and annoying. Stop it.

    • @AnandsLab
      @AnandsLab  4 місяці тому +2

      Its a learning process. I already addressed it. I was starting out then. My recent videos should be easier on the eye :-)

  • @espressomatic
    @espressomatic 4 місяці тому

    Noooooooooo. Run it in a VM. Better still, don't use Proxmox.

    • @AnandsLab
      @AnandsLab  4 місяці тому

      See my other detailed response. I have had no issues in 2 years of running it.

  • @debnathmriganka2010
    @debnathmriganka2010 29 днів тому

    I am very new on linux, Please can you help me some issue of proxmox. regarding networking.

    • @AnandsLab
      @AnandsLab  16 днів тому

      Please reach out on discord.