Hey everyone! I've been dabbling with Docker for a while now, but I've run into a snag. When I try to run multiple Docker applications, some of them clash because they use the same port. Even after changing the port to something new, I'm still unable to access the apps via my IP address. Does anyone have suggestions on how to successfully run multiple Docker apps with different ports on the same system? Thanks in advance!
2 Answers
When you're setting up your port mappings for Docker, remember that it's defined as `host:container`. You can choose almost any unused port for the host, like `8181:80`. The important part is knowing that the container's internal port usually shouldn't be changed unless necessary. Most images have a default internal port (like `80`), and that's what you'll want to map to an external port that’s not already in use. So you might set it as `8080:80`, `8181:80`, or various other combinations, just avoid anything like `80:8080`. This way, you can run multiple apps without conflicts!
Could you share a bit more about your specific setup? For example, what ports are you using for your outside (host) and inside (container)? It might help to clarify if you're using something like `8081:80` for one app and `8080:80` for another. I had similar issues trying to run qBittorrent and Immich together, both wanted `8080`, and it was tricky until I figured out how to map them to different ports. There's definitely a way to get both running without too much hassle!

Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux