v2rayN Port Already in Use: Find the Conflicting Process and Change the Local Listening Port

If startup reports that a port is already in use, another program is probably using local port 10808 or 10809. This guide shows how to find the process with system commands and safely change the local listening port in v2rayN.

At a Glance

This guide is for Windows users whose v2rayN core fails to start and whose logs show bind or address already in use. First confirm the conflicting port, then identify the process by PID. Next, close the old process or change the v2rayN listening port, and finally update the port settings in the system proxy, browser, and other external applications.

First, distinguish 10808, 10809, and core listening failures

After v2rayN starts the V2Ray or Xray core, it creates inbound listening ports on the local machine. A common configuration uses 10808 for SOCKS and the adjacent 10809 for HTTP. Some newer configurations may use a mixed listener and show only one main local port in the interface. Always verify the actual ports under “Settings” → “Parameters” and in the current core log; do not rely on default values alone.

The listening port is the local entry point for applications connecting to the proxy core. Browsers, command-line tools, and the system proxy first connect to this port on 127.0.0.1, after which the core establishes outbound connections according to the selected node and routing rules. If another process is already listening on the same address, protocol, and port, the new core cannot bind to it again.

Start the programRead the configurationBind the local portAccept proxy requestsConnect outbound by rule
What to check Common values What a conflict looks like
SOCKS listener 127.0.0.1:10808 The core cannot create the SOCKS inbound listener, so applications using that port fail to connect
HTTP listener 127.0.0.1:10809 The system proxy or manually configured HTTP proxy cannot connect
Updated listener 127.0.0.1:20808、20809 The core starts, but external applications still need their port settings updated

Use the log to distinguish a port conflict from a permissions issue

Do not rely on the taskbar icon color alone. Open the v2rayN log window, start the core again or restart the service, and note the IP address, port, and protocol in the error. Look for bind, listen, address already in use, and Only one usage. If the log clearly points to 127.0.0.1:10808, query that port specifically instead of scanning every connection.

The same startup failure can have entirely different causes. Configuration syntax errors usually show messages such as failed to load config or invalid field. An unreachable remote node usually fails after local listening succeeds. Prioritize port troubleshooting only when binding to the local address fails.

Error: listen tcp 127.0.0.1:10808: bind: Only one usage of each socket address is normally permitted

Cause and fix: Port 10808 is already being used by another process. Use netstat or PowerShell to find the PID, close the duplicate core, or move v2rayN to an unused port.

Error: failed to listen on address 127.0.0.1:10809

Cause and fix: The HTTP inbound listener could not bind. Check which process is listening on 10809 and make sure an older v2rayN instance or leftover core is not still running in the background.

Error: bind: An attempt was made to access a socket in a way forbidden by its access permissions

Cause and fix: The port may be within Windows’ excluded port range or blocked by a security policy. Check the excluded ranges first; if the port is included, switch directly to an ordinary high port such as 20808 or 20809.

netsh interface ipv4 show excludedportrange protocol=tcp
netsh interface ipv6 show excludedportrange protocol=tcp

An excluded port range is different from ordinary process usage. With normal usage, LISTENING and a PID are usually visible. An excluded range may have no corresponding user process, yet Windows still rejects the bind. If 10808 or the newly selected port falls within an output range, do not try to force-stop system services; choose a port outside the range instead.

Find the conflicting process with netstat and PowerShell

Run netstat first in Windows Terminal or Command Prompt. The -a parameter shows connections and listening ports, -n displays numeric addresses, and -o shows the process PID. Query 10808 and 10809 separately to avoid mistaking the same number in a remote connection for a local listener.

netstat -ano -p tcp | findstr ":10808"
netstat -ano -p tcp | findstr ":10809"

Focus on the Local Address and State columns. For example, Local Address 127.0.0.1:10808 with State LISTENING and 4321 in the final column means PID 4321 is listening on that port. If the local address uses another port while the foreign address contains 10808, it is not the local listener you are looking for.

  1. Record the PID in the final column of the LISTENING row, such as 4321.
  2. Run tasklist /FI "PID eq 4321" to see the process name.
  3. If the name is xray.exe or v2ray.exe, first check whether another v2rayN instance is already running.
  4. If it is another application, open the Details tab in Task Manager and verify the PID and file path.
  5. After confirming what the process does, decide whether to exit the application, stop its service, or change the port.
tasklist /FI "PID eq 4321"

Get-NetTCPConnection -State Listen |
  Where-Object { $_.LocalPort -in 10808,10809 } |
  Select-Object LocalAddress,LocalPort,OwningProcess

Get-CimInstance Win32_Process -Filter "ProcessId=4321" |
  Select-Object ProcessId,Name,ExecutablePath,CommandLine

PowerShell’s OwningProcess is the PID. ExecutablePath and CommandLine can help distinguish the core launched by the current v2rayN instance, a core in an old directory, and another local proxy program. Reading some process paths requires administrator privileges, but never terminate a process based only on its executable name.

Conclusion: verify the PID and path together

Seeing xray.exe or v2ray.exe does not mean it is safe to terminate it immediately. Check the command-line arguments and installation directory first, and confirm whether it belongs to an old instance whose interface has already closed. This avoids interrupting another configuration that is still working.

Close the leftover process or change the v2rayN local port

If the port is held by a duplicate v2rayN instance, return to its main window and exit normally if possible. If the window has disappeared but the core is still running, end the matching process by PID in Task Manager. Use a force-stop command only after verifying the path, PID, and purpose. System services, virtualization services, and security software should not be terminated casually just to free an ordinary proxy port.

Stop-Process -Id 4321

taskkill /PID 4321 /F

If the program using the port must remain open, changing v2rayN is the better option. In the common Chinese interface, go to “Settings” → “Parameters” and find the local listening port in the “Basic Settings” section. Depending on the major version, it may be labeled “Local Listening Port,” “Local SOCKS Port,” or something similar. Change 10808 to 20808, save the settings, then choose “Restart Service” or fully exit and relaunch v2rayN.

  1. Take a screenshot of or write down the original port, 10808, so you can restore it if needed.
  2. Under “Settings” → “Parameters,” change the main local port to 20808.
  3. If the interface provides a separate HTTP port, change 10809 to 20809.
  4. Save the parameters, restart the current core, and check the log for a successful listening message.
  5. Run netstat again and confirm that the new PID is listening on 127.0.0.1:20808.
Approach When to use it Next step
Exit the old instance The same client was started twice Keep one instance and restart the core
Terminate the leftover core The core still listens after the interface is closed Verify the PID and path, then terminate the process
Change to 20808 and 20809 The application using the port must continue running Update the system proxy and external applications
Avoid the excluded range The system rejects the bind even though no listening PID appears Choose a high port outside the excluded range

Update the system proxy and external applications after changing the port

A successfully started core only means that local listening has been restored; it does not mean every application is using the new port. If the Windows system proxy still points to 127.0.0.1:10809 while v2rayN now uses 20809, the browser will keep requesting the old port. The core may appear healthy while websites fail to load. Reconfigure the system proxy, or have v2rayN apply the system proxy settings again.

In the system proxy menu on the v2rayN main screen, select “Auto Configure System Proxy” again. Then open Windows “Settings” → “Network & Internet” → “Proxy” and verify the address and port. Browsers, download tools, terminal programs, and development tools with manually configured proxies do not automatically follow system settings; update 10808 or 10809 to the new value in each one.

Get-NetTCPConnection -State Listen |
  Where-Object { $_.LocalPort -in 20808,20809 } |
  Select-Object LocalAddress,LocalPort,OwningProcess

Test-NetConnection 127.0.0.1 -Port 20808

If Test-NetConnection returns TcpTestSucceeded as True, the local machine can connect to that TCP listening port, but this does not verify that the node itself works. For a complete check, confirm in the core log that the outbound connection succeeds and verify that routing rules send test traffic through the expected exit.

Conclusion: the new port must be updated throughout the configuration chain

The listening port, system proxy port, and in-app proxy port must match. Changing only one field in v2rayN often turns “startup failed” into “the core is running but applications cannot connect.”

Common questions and troubleshooting limits

The PID shown by netstat is missing from Task Manager?

Run netstat again first. A short-lived process may have exited and been replaced by a new PID. You can also run Get-NetTCPConnection in an elevated PowerShell window, then look up the process by OwningProcess.

Still getting a port-in-use error after changing to 20808?

Query 20808 separately with netstat and check the Windows TCP excluded port ranges. If a LISTENING entry appears for the new port, switch to another unused port outside the excluded range, such as 21808.

What if only 10809 conflicts while 10808 is free?

First confirm in the parameter settings whether SOCKS and HTTP are configured separately. If independent settings are available, change only the HTTP port. If the ports are generated as adjacent values, adjust the main local port and update every application.

Why is the port not released immediately after terminating the core?

Wait a few seconds and check the LISTENING state again. TIME_WAIT connections generally do not mean the port is still being listened on. If a LISTENING row remains, another process still owns the port; continue troubleshooting with the latest PID.

Does the conflict return every time Windows starts?

Check whether both v2rayN and the other application are configured to start with Windows, and look for duplicate v2rayN directories or shortcuts. Keep only one startup entry, or assign different listening ports to the two programs.

After troubleshooting, keep a short record of the final ports, the process name using the port, the path associated with its PID, and the applications you changed. If a v2rayN update or reimported configuration restores the default listening port, you can compare it with your notes instead of scanning every process again.