code-8
code-8

Reputation: 58652

Find out what is running on my port 80 on a Mac OSX

I'm trying to start a hello-world container app that I just build using nodejs on my Mac OS X.

docker run -p 80:80 --name web -d node-hello

343503e8a29ac207c821caa7990373580dd6a1951e1e4936bbf9c71b0eff2213
docker: Error response from daemon: driver failed programming external connectivity on endpoint web (e6035cf3ae4df37f1a96a5a7ed321e6a0ae7ad484c05aae8d7b67f3d86fa3a76): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE). 

Debug Steps

I went to the address

enter image description here

I ran this

lsof -i ":80"

and got

COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Google    956 bheng  225u  IPv6 0x5bed1c283af57fa7      0t0  TCP [2607:f518:15e:9540:3105:c54f:bd3c:14ed]:63120->yul02s04-in-x10.1e100.net:http (ESTABLISHED)


(netstat -an | grep LISTEN | grep 80) 
tcp4       0      0  127.0.0.1.4380         *.*                    LISTEN                                                                
tcp46      0      0  *.80                   *.*                    LISTEN 

How do I find out what is exactly running on my port 80 right now ?

Upvotes: 10

Views: 28725

Answers (1)

bakhoang
bakhoang

Reputation: 151

Prefix lsof with sudo to see process ids that you don’t own.

sudo lsof -i:80

Upvotes: 15

Related Questions