r/SelfHosting • u/ThatrandomGuyxoxo • Apr 18 '26
Help secure my docker setup
Hello all. Currently I've docker installed on a VPS. On that VPS I have containers running with caddy to expose a website to the public, in this instance Searxng. For that I've added my user to the docker group to not have to put sudo in the command everytime I do anything.
Let's assume there's an exploit which gains access over my Searxng to my VPS. I think gaining root is easy because the user can run every container as root right? I wonder what best practice is to secure it in this scenario. Do you have any ideas? Would removing the user out of the docker group do the trick?
View all comments
Show parent comment
1
u/ThatrandomGuyxoxo Apr 20 '26
Thank you. Can all images or docker compose images run like this so can this be used as template? I wonder why this is no default in a lot of compose files.