Resolving: Port conflict with this site's domain

Issue Summary

Getting the error: ‘There is a port conflit with this site’s domain’.

I’m trying to resolve it, since I prefer working with domains like: mydomain.local instead of localhost:10512.

This is what the error looks like:

There are bazillions of posts out there, with all kinds of different suggestions. I’ve tried them all, without any luck.

When I visit the URL, then it hits some other server on my machine:
localhost shows It works!

What I’ve tried

1. Switches to ‘Use localhost’

First I wanted to see if it works if I switch to localhost (as Local suggests). And it works. I do prefer the .local-domains, though.

2. Stopping NGINX

First I ran:

lsof -i :80 and saw that a bunch of NGINX-instances ran. So I quite Local, ran sudo nginx -s stop, started Local again. Which resultet in same error. Even though that if I run lsof -i :80 afterwards, that comes up blank.

3. Swapped server-type to Apache

I tried swapping server-type (from NGINX to Apache). But that didn’t do anything.

4. Reinstalled Local

I reinstalled Local without it doing anything.

5. Reinstalled NGINX from Brew

I ran: brew remove nginx and then brew install nginx.
Didn’t do anything.

6. Tried to figure out what was running on Localhost

So it must be something else, that occupied localhost. But I can’t figure out what that is (Googled A LOT).

Replication (what happend before this error)

I have just migrated my entire computer (from another Macbook). On the old machine I was using Local By Flywheel v. 3.3.X (without any problems). But I couldn’t start the virtual machine on this new computer. So I uninstalled Local By Flywheel (following this guide: https://localwp.com/help-docs/troubleshooting/how-do-i-uninstall-local-by-flywheel-on-macos/

After this I downloaded and installed the latest version of Local and then this issue started.

System Details

  • Local version: 5.9.7+5156
  • Mac OS (Big Sur 11.1).
  • There aren’t any error logs (no directory called ‘local’ in ~/Library/Logs/').

Hey @zeth – From that screenshot of the browser, that looks like the default response from a newly installed Apache server. Local has a different, less “plain” page when it’s created, so what you’re seeing is likely some other piece of software.

Great work testing things out! All of the steps you’ve outlined are ones that I would recommend. I think what’s happening is that Big Sur ships with an Apache server. You should be able to get things working by doing:

  1. Quit Local

  2. Stop the default apache server

    sudo apachectl stop
    
  3. Verify that nothing is listening on port 80

    These commands should give you an idea of all the processes that are listening on Port 80. Note that sudo is needed because some of these processes are run with elevated privileges.

    sudo lsof -i:80;
    sudo lsof -tnP -i:80 | xargs -n 1 ps -p
    
  4. Start Local

Can you give that a shot and let me know if that fixes things for you? If you are still running into issues, can you share the output of the terminal after running the above commands?

4 Likes

I love you!
It worked.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.