Docker app for macOS uses port 8080. How can I change that?

I’ve noticed the Docker app for macOS uses port 8080. However, this causes issues for other processes which expect to use 8080.

lsof -i :8080

COMMAND     PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
com.docke 63800 myuser  128u  IPv6 0xaedf71127991fd8f      0t0  TCP *:http-alt (LISTEN)

Is there a way I can change which port the Docker app for macOS uses? An ENV variable, or command-line flag?


  • macOS Montery (Intel) Version 12.4 (21F79)
  • Docker Desktop 4.10.1 (82475)
  • Engine: 20.10.17
  • Compose: 1.29.2
  • Credential Helper: v0.6.4
  • Kubernetes: v1.24.1
  • Snyk: v1.827.0

Are you sure this is not a container you’ve got running, that publishes this port? My Mac (M1) yields no results for that command. Desktop 4.9.1 (81317). Same for 4.10.1 (82475).

I tried too and I agree with @avbentem so I just want to share some ideas why you could see that port 8080 is used even if you run docker ps or docker ps -a and you can’t see any containers.

  1. If you run Kubernetes on Docker Desktop, Kubernetes containers are not visible by default. However, Kubernetes itself will not use port 8080 but some services could. If you want to enable showing Kubernetes containers, go to the Kubernetes settings and aneble “Show system containers (advanced)”. It would probably not help since you could just list kubernetes services and those are not visible in the list of containers, but at least you know what containers are running on your machine.
  2. Extensions can also use ports. For example when you install “Portainer”, itt will use port 8000, 9000 and 9443 on the local IP 127.0.0.1. Extension containers are also hidden by default if I remember correctly. If you want to see the extension containers, go the the Extensions settings below “Software updates” and “Kubernetes” and enable “Show Docker Extensions system containers”
1 Like

Yes, I believe @avbentem and @rimelek are correct. Before seeing your replies I clicked “Clean / Purge data” and the port was freed up.

It was probably a running container I was unaware of.

Thanks!

@ejstembler Hello. I have the same problem. But Clean/Purge data does not help me. Do have some an idea, what i should to do?

Please, read all the suggestions and tell us what you checked and made sure that is not the cause of the issue. For example what I wrote in my previous comment in this topic and whihc I also partially wrote your new topic:

To avoid talking about the same thing in two different topics, let’s continue in yours.

I had a similar problem, for me, it was an extension using the port, I didn’t need that extension so I uninstalled it.

It would’ve been great if there was a way to change the ports the extensions use.

1 Like

I also discovered that having Docker Swarm enabled may create issues. I previously had a local swarm with the port taken for the service. The service was no longer working, but the Docker was still in Swarm mode – and I guess still holding the port for some reason. Once I “left” the Swarm and restarted the Docker – all cleaned up:

docker swarm leave --force
# and now restart docker