this post was submitted on 30 Apr 2026
38 points (100.0% liked)
Open Source
46718 readers
192 users here now
All about open source! Feel free to ask questions, and share news, and interesting stuff!
Useful Links
- Open Source Initiative
- Free Software Foundation
- Electronic Frontier Foundation
- Software Freedom Conservancy
- It's FOSS
- Android FOSS Apps Megathread
Rules
- Posts must be relevant to the open source ideology
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
- !libre_culture@lemmy.ml
- !libre_software@lemmy.ml
- !libre_hardware@lemmy.ml
- !linux@lemmy.ml
- !technology@lemmy.ml
Community icon from opensource.org, but we are not affiliated with them.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
So, how do I use iptables to open ports for docker apps? Usually I install a thing that requires for example port 8080, and I open the port 8080. Does docker respect iptables?
this is my compose file for monbooru, ive added some comments to show you what each thing does, if you want to change the port simply change the the first 8080. all of these value:value mean that the first value is your machine, and the second one inside the container. that's it, create a folder named monbooru, create a file named docker-compose.yml, add the thing i gave you below and save it. with your terminal cd into the directory where the compose file lives and do docker compose up -d and it will download the image and it'll be runnin. believe me, i used to prefer to not use docker because i thought, ohh i have to learn to use docker, but honestly i wish i knew it was this simple long before so i wouldnt have done so many installs of some apps where i'll lose my data
Can you set up docker in a way that it does not mess with my firewall?
it will not mess with your firewall at all, you just select the port, that's it, most apps come with a predefined port but you can change it. ive had 0 issues with ports or firewalls. if you try this and need some help let me know.
Docker automatically opens ports your containers need through iptables. Because of this, it bypasses rules set by
ufw, which is great.Podman does not do this afaik, and since it only runs rootless it's a lot less risky as well.
You see, this is an issue for me because I don't want my ports "automagically" being open, I want to know exactly which ports are in use and by which apps, I don't want package manager to manage my ports. I know this sounds "old school" but I prefer to control my ports manually and I don't want my iptables rules be a mess I can't understand.
Maybe that's more of a "me" issue than a docker issue, but anyway, I prefer to not use such software.
No I totally understand. This is why I use podman personally. You can use the same images as you would with docker, even its compose is pretty much exactly the same I think.