# Localhost unavailable to other applications after closing Local

**URL:** https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522
**Category:** Support
**Created:** [September 28, 2022, 11:44pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522 "2022-09-28T23:44:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![sternerstuff](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sternerstuff](https://community.localwp.com/u/sternerstuff)
#### Post date: [September 28, 2022, 11:44pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/1 "2022-09-28T23:44:19Z")

</div>

### Issue Summary

While I run sites via Local, I also run sites via Docker containers that may use 127.0.0.1:80 for web traffic. Once Local has been opened on my computer, I have to restart the computer to free these ports back up. After exiting Local, but w/o restarting the computer, trying to access domains assigned to 127.0.0.1 show the Local 404 page (" The site you requested does not have an associated route in Local.  
**If you continue to get this message after refreshing, try restarting the Local site.**").

#### Troubleshooting Questions

- Does this happen for all sites in Local, or just one in particular?

N/A

- Are you able to create a new, plain WordPress site in Local and access it in a Browser?

N/A

#### Replication

- Open Local
- Start a site
- Stop site
- Close local
- Run another site on 127.0.0.1. Current use case is Docker w/in WSL2, but could also apply to WAMP, XAAMP, etc.
- See Local 404 page
- Clear cache, disable cache, whatever
- Still see Local 404 page

#### System Details

- Which version of Local is being used?  
6.4.3+6116

- What Operating System (OS) and OS version is being used?  
Win11 Pro, 21H2, build 22000.978

- Attach the Local Log. See this Help Doc for instructions on how to do so:

[local-lightning.log](https://community.localwp.com/uploads/short-url/4PRLUjkVHUEnqPrLAQajOQ3BKv2.log) (140.1 KB)

### Security Reminder

Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

### Author: ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)
#### Post date: [October 1, 2022, 8:57pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/2 "2022-10-01T20:57:21Z")

</div>

Hi @sternerstuff! Is this still an issue if you change the Router Mode to Site Domains? [What is Router Mode? - Local](https://localwp.com/help-docs/advanced/router-mode/)

---

<div class="post-metadata">

### Author: ![sternerstuff](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sternerstuff](https://community.localwp.com/u/sternerstuff)
#### Post date: [October 5, 2022, 5:14pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/3 "2022-10-05T17:14:45Z")

</div>

It is _specifically_ a problem when “Site Domains” is the router mode.

---

<div class="post-metadata">

### Author: ![sternerstuff](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sternerstuff](https://community.localwp.com/u/sternerstuff)
#### Post date: [October 5, 2022, 5:19pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/4 "2022-10-05T17:19:05Z")

</div>

Switching to “localhost” mode actually seems to resolve the issue.

---

<div class="post-metadata">

### Author: ![sternerstuff](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sternerstuff](https://community.localwp.com/u/sternerstuff)
#### Post date: [November 4, 2022, 10:56pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/5 "2022-11-04T22:56:00Z")

</div>

@Nick-B I’d like to add that I don’t think that it’s related to either mode. I would wager the bug is that Local isn’t freeing port 80 when you stop a site or close the application altogether. To go step by step through my troubleshooting of this theory:

Btw - **if you’re encountering this bug** , skip to the last 4 steps to continue work w/o restarting your computer.

1. Boot computer
2. Check out what’s happening on port 80 with `netstat -ano | find "80" | find "LISTEN"` and then `wmic process where "ProcessID={process listening on 80}" get ProcessID, ExecutablePath` Any time these steps reference activity on port 80, this is the process used to determine that
3. Nothing on 80
4. Start Local
5. Nothing on 80
6. Start site
7. Port 80 is occupied by Local’s Nginx service (`C:\Users\Ethan\AppData\Local\Programs\Local\resources\extraResources\lightning-services\nginx-1.16.0+6\bin\win32\nginx.exe`)
8. Stop site.
9. Same process still living on port 80
10. Quit Local
11. Oddly enough, while writing these instructions, port 80 was freed!
12. Start Local again
13. Start site again
14. Port 80 occupied again
15. Stop site
16. Quit Local
17. Port 80 **still occupied** by Local nginx process
18. Start Local
19. Start site
20. See **a second process is now listening on port 80**! Also Local’s nginx executable.
21. Stop site
22. Switch router mode from “Site Domain” to “Localhost”
23. See the second nginx process has stopped, but the original one is still listening
24. quit local
25. 80 still occupied
26. open task manager
27. find nginx.exe
28. force quit
29. 80 is available

Obviously there’s a lot there, and I don’t know if it’ll help reproduce, but Local is not reliably stopping its nginx process.

---

<div class="post-metadata">

### Author: ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)
#### Post date: [November 8, 2022, 9:15pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/6 "2022-11-08T21:15:04Z")

</div>

Hi @sternerstuff! Thank you for all of the details here that is super helpful. I’ve raised this with our dev team. The intended functionality should be that Local is killing these processes upon shut down but after testing it does seem to be intermittent at times. We are going to look into this further with some more testing and see what can be done! We’ll be sharing any updates here or reaching out if we need any other follow-up.

---

<div class="post-metadata">

### Author: ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)
#### Post date: [February 6, 2023, 9:15pm UTC](https://community.localwp.com/t/localhost-unavailable-to-other-applications-after-closing-local/33522/7 "2023-02-06T21:15:22Z")

</div>

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