Skip to content
Advertisement

How to stop nginx from using port 80

I’m trying to update nginx using sudo apt-get install nginx, but it is giving me an error message related to port 80 being occupied. When I run

JavaScript

I get

JavaScript

Although I wasn’t able to easily understand what each column means from the --help function, I suppose that in this example 6845 is the process ID of nginx. If I try to kill it using

JavaScript

and run sudo netstat -tlnp | grep 80 again, I see

JavaScript

In other words, it seems like nginx has immediately started listening on port 80 again under a different process ID. How can I stop nginx from running? (I’ve also tried sudo systemctl stop nginx but to no avail).

Advertisement

Answer

I managed to solve the problem by going to 127.0.0.1:80 in my browser, which brought me to a GitLab login page. I had forgotten that I had once installed GitLab but wasn’t using it. After uninstalling GitLab, port 80 was no longer occupied.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement