# Access from Local Network

**URL:** <https://forums.docker.com/t/access-from-local-network/133079>\
**Category:** Docker Desktop\
**Tags:** docker, macos\
**Created:** [December 17, 2022, 10:16pm UTC](https://forums.docker.com/t/access-from-local-network/133079 "2022-12-17T22:16:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![dockraken](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/dockraken/32/33086_2.png) [@dockraken](https://forums.docker.com/u/dockraken)\
**Post date:** [December 17, 2022, 10:16pm UTC](https://forums.docker.com/t/access-from-local-network/133079/1 "2022-12-17T22:16:46Z")

</div>

Can’t access to container from local network.  
macOS Ventura Version 13.1 (22C65)  
Docker Desktop 4.15.0 (93002)

Running MySQL server. Trying access to server from devices in local network. Spend one week on slowing problem , but still no results. Can anyone guide me please ?

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 18, 2022, 5:41pm UTC](https://forums.docker.com/t/access-from-local-network/133079/2 "2022-12-18T17:41:32Z")

</div>

And how exaxtly are you trying to access the container? The IP addresses of the containers will not be accessible from the host. You need to forward host ports to the containers.

---

<div class="post-metadata">

**Author:** ![dockraken](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/dockraken/32/33086_2.png) [@dockraken](https://forums.docker.com/u/dockraken)\
**Post date:** [December 18, 2022, 6:04pm UTC](https://forums.docker.com/t/access-from-local-network/133079/3 "2022-12-18T18:04:26Z")

</div>

During studding (SQL) process i’m really like Docker. But i’m beginner and need much more time for Docker understanding. So.

- I’m run MySQL and MSSQL severs in macDocker app ,and can interact with both db throw localhost:1433 and lockalhost:3306
- But can’t connect to db from other devices from local network ( another words from wi-fi )

1. I was change network in Docker setting on 192.168.1.0/24 (default getaway in local network 192.168.1.1)
2. I’m crate docker network with :

```auto
docker network create \
  --driver=bridge \
  --subnet=192.168.1.0/16 \
  --ip-range=192.168.2.0/24 \
  --gateway=192.168.2.1 \
  br0

```

1. Bind container to created bridge

PS. sorry for my noob talk 😟

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 18, 2022, 6:14pm UTC](https://forums.docker.com/t/access-from-local-network/133079/4 "2022-12-18T18:14:12Z")

</div>

I can only repeat myself 🙂

> [@rimelek](#):
>
> The IP addresses of the containers will not be accessible from the host. You need to forward host ports to the containers.

Docker Desktop runs containers in a virtual machine. Doesn’t matter how you change the IP address of the containers, you will not be able to access it from the host or other devices. You need port forwarding.

```auto
docker run -d -p 8888:80 --name httpd httpd:2.4

```

It would run HTTPD and make it available on port 8888 from the host and if your firewall allows it, you can access it from other devices. The port number on the right side is the port on which the service inside the container is listening.

---

<div class="post-metadata">

**Author:** ![dockraken](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/dockraken/32/33086_2.png) [@dockraken](https://forums.docker.com/u/dockraken)\
**Post date:** [December 18, 2022, 7:34pm UTC](https://forums.docker.com/t/access-from-local-network/133079/5 "2022-12-18T19:34:40Z")

</div>

Got it .  
When trying do same with MySQL  
`docker run --name -p 8888:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql`  
receiving error :  
`docker: Error response from daemon: pull access denied for 8888, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.`  
It’s trying pull it from hub-repo ?

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 18, 2022, 8:34pm UTC](https://forums.docker.com/t/access-from-local-network/133079/6 "2022-12-18T20:34:12Z")

</div>

You have no container name after `--name`. That is the problem.

---

<div class="post-metadata">

**Author:** ![dockraken](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/dockraken/32/33086_2.png) [@dockraken](https://forums.docker.com/u/dockraken)\
**Post date:** [December 19, 2022, 4:28pm UTC](https://forums.docker.com/t/access-from-local-network/133079/8 "2022-12-19T16:28:39Z")

</div>

it’s work! On other devices i connect to mac’s IP with selected ports . 🫡  
@rimelek Thanks a lot for help ! Hope this post help confused beginners like me 😅

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 19, 2022, 10:08pm UTC](https://forums.docker.com/t/access-from-local-network/133079/9 "2022-12-19T22:08:24Z")

</div>

Yes, you need to use the public (on a specific network) IP address of the Docker host machine from remote devices.

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 22, 2026, 8:16pm UTC](https://forums.docker.com/t/access-from-local-network/133079/10 "2026-03-22T20:16:31Z")

</div>

I have been struggling with this same thing. I have tried copying and pasting these commands and have had no luck. I have read this thread like 15 times hoping to find something I didn’t notice.

docker run --name -p 8888:3306 -e MYSQL\_ROOT\_PASSWORD=my-secret-pw -d mysql

do I need to put my actual credentials here? I know it’s a dumb question but this is all new and noticed somethings are capitalized and others aren’t. Thank you in advance

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 22, 2026, 10:39pm UTC](https://forums.docker.com/t/access-from-local-network/133079/11 "2026-03-22T22:39:43Z")

</div>

And you are repeating the same mistake 🙂

> [@rimelek](#):
>
> You have no container name after `--name`. That is the problem.

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 23, 2026, 10:03am UTC](https://forums.docker.com/t/access-from-local-network/133079/12 "2026-03-23T10:03:11Z")

</div>

docker run --name HA -p 8888:3306 -e MYSQL\_ROOT\_PASSWORD=my-secret-pw -d mysql

I did try the name updated above, but then I get an error.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 23, 2026, 11:20am UTC](https://forums.docker.com/t/access-from-local-network/133079/13 "2026-03-23T11:20:03Z")

</div>

Your command works fine for me. Though, you might want to use a volume or bind a host folder into the container folder where the database data is persisted. Otherwise, you will lose all data when the container is removed.

Thus said, please share the exact error message you see in the container logs..

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 23, 2026, 9:51pm UTC](https://forums.docker.com/t/access-from-local-network/133079/14 "2026-03-23T21:51:31Z")

</div>

docker: Error response from daemon: Conflict. The container name “/HA” is already in use by container “f408a86b95f18a131a2cc50b972903bc1f71d4aa997e98bf76397524d7a98a16”. You have to remove (or rename) that container to be able to reuse that name.

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 23, 2026, 9:55pm UTC](https://forums.docker.com/t/access-from-local-network/133079/15 "2026-03-23T21:55:10Z")

</div>

> [@erikgzlz84](#):
>
> docker run --name HA -p 8888:3306 -e MYSQL\_ROOT\_PASSWORD=my-secret-pw -d mysql

docker: Error response from daemon: Invalid container name (–HA), only [a-zA-Z0-9][a-zA-Z0-9\_.-] are allowed

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 23, 2026, 10:44pm UTC](https://forums.docker.com/t/access-from-local-network/133079/16 "2026-03-23T22:44:58Z")

</div>

> [@erikgzlz84](#):
>
> docker run --name HA -p 8888:3306 -e MYSQL\_ROOT\_PASSWORD=my-secret-pw -d mysql

docker: Error response from daemon: Conflict. The container name “/HA” is already in use by container “f408a86b95f18a131a2cc50b972903bc1f71d4aa997e98bf76397524d7a98a16”. You have to remove (or rename) that container to be able to reuse that name.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 24, 2026, 7:04am UTC](https://forums.docker.com/t/access-from-local-network/133079/17 "2026-03-24T07:04:05Z")

</div>

> [@erikgzlz84](#):
>
> docker: Error response from daemon: Invalid container name (–HA), only [a-zA-Z0-9][a-zA-Z0-9\_.-] are allowed

It is impossible that the exact command you quoted above this error message was used.

> [@erikgzlz84](#):
>
> Conflict. The container name “/HA” is already in use by container “… ”. You have to remove (or rename) that container to be able to reuse that name.

A name has to be unique, when a container with the same name exists, of course it won’t be able to create a new container using the same name. You should find containers with the names you created using `docker ps -a`.

Docker makes more fun, if you know what you are doing. Here are recommended links to learn the basics and concepts:

- General “self-paced” training about containers: [Training Materials](https://container.training/intro-selfpaced.yml.html#1)
- @rimelek’s tutorials: [Welcome to Learn Docker’s documentation! — Learn Docker documentation](https://learn-docker.it-sziget.hu/en/latest/)
- What is a container (docker docs): [What is a container? | Docker Docs](https://docs.docker.com/guides/walkthroughs/what-is-a-container/)

---

<div class="post-metadata">

**Author:** ![erikgzlz84](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/erikgzlz84/32/63990_2.png) [@erikgzlz84](https://forums.docker.com/u/erikgzlz84)\
**Post date:** [March 24, 2026, 9:38am UTC](https://forums.docker.com/t/access-from-local-network/133079/18 "2026-03-24T09:38:44Z")

</div>

I appreciate you sharing those resources. I am a super noob 😅. I really just wanted to run Home Assistant on my Mac server and saw the wonderful potential with Docker. I am pretty tech savvy and grasp the concept here, but to be honest this is a pain just to get one container to talk to the other devices on my network. I successfully installed Home Assistant in this container but clearly this seems like more work then I bargained for to have this container do a simple port forwarding. I guess I will have to revisit this when I have time or bite the bullet and just run a VM on my server. Thank you again for your time.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 24, 2026, 5:32pm UTC](https://forums.docker.com/t/access-from-local-network/133079/19 "2026-03-24T17:32:53Z")

</div>

It actually is very simple. You managed to create at least on mysql container where you published the container port 3306 to the host port 8888. Thus, you have forwarded host port 8888 to container port 3306.
