<< cmake: install files/directories | Home

Check what local application is blocking your tcp/ip port

If you have the problem that starting a server (e.g. tomcat/8080) leads to an error because the port is already blocked. You can use this call:

sudo lsof -i -P -n | grep LISTEN

This will result into something like following output:

apache2   3085        www-data    4u  IPv6  42617      0t0  TCP *:80 (LISTEN)
apache2   3086        www-data    4u  IPv6  42617      0t0  TCP *:80 (LISTEN)
docker-pr 3805            root    4u  IPv6  47126      0t0  TCP *:5000 (LISTEN)
docker-pr 3822            root    4u  IPv6  43660      0t0  TCP *:8088 (LISTEN)
docker-pr 3887            root    4u  IPv6  41565      0t0  TCP *:8443 (LISTEN)
docker-pr 3899            root    4u  IPv6  48297      0t0  TCP *:8080 (LISTEN)
dnsmasq   4180 libvirt-dnsmasq    6u  IPv4  48409      0t0  TCP (LISTEN)

And I see, in this case docker some docker process is blocking port 8080.

For the example of docker, you could see what containers are running on what port:

sudo docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS                    PORTS                                            NAMES
09b4d248ce0e        fawserver:latest              "/entrypoint.sh"         6 days ago          Up 3 hours      >8080/tcp,>8443/tcp   fawserver```

Here we go, my docker-version of the server is still running.

sudo docker stop fawserver

And the port is available again :+1:

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!