How to Access My Docker Container from Other Devices on the LAN?

0
13
Asked By TechyExplorer88 On

I've just started using Docker and set up Immich based on the instructions from their website. It works perfectly on the host machine, but I'm struggling to access it from any other device on my local network. I've tried using localhost:2283 and looked up the container's IP, which is 172.18.0.5, but that hasn't worked either. I even changed the port mappings in docker-compose.yml from 2283:2283 to 2222:2283 to see if there was a conflict, but it didn't help. Ultimately, I want to set it up for remote access through a domain or nginx, but for now, how can I make it available on my LAN? Thanks!

1 Answer

Answered By CodingGuru42 On

When you're trying to access your service from a different device on the LAN, 'localhost' won't work because it refers to the loopback interface of the machine you're on. Instead, you should use the IP address of the machine that's running Docker. For example, if your Docker host's IP is 192.168.1.100, then try accessing it from another device using that IP address with the port. Also, just make sure that any firewall settings on your host machine allow connections on that port.

NetworkWhiz101 -

Exactly! Just ensure you're targeting the right machine's IP on the network. If you're unsure what your Docker host's local IP is, you can usually find it by running 'ipconfig' on Windows or 'ifconfig' on Linux/Mac Terminal.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.