<blockquote>
  <p>Windows 10</p>
</blockquote>

<p>Run <code>netstat -ab &gt;file.txt</code> then <code>notepad file.txt</code> and search on <code>5040</code>. I suspect you will find <code>CDPSvc</code> immediately underneath - on my machine this "Connected Devices Platform Service" is already using your port. </p>

<p>If that's so, search on <code>5041</code>, then <code>5042</code> and continue up until search can't find it. That port is free: change your rpcport to match it.</p>

CC BY-SA 4.0
2019-03-24T19:10:22.297Z
Nothing happens when I run that command
frogman578
CC BY-SA 4.0
2019-03-24T22:46:02.490Z
There are two commands.
Alistair Mann
CC BY-SA 4.0
2019-03-25T18:36:10.947Z
I don't quite understand, could you elaborate more?
frogman578
CC BY-SA 4.0
2019-03-25T22:13:24.903Z
1/4: Open up an [Admin Command Prompt](https://superuser.com/a/968225)
Alistair Mann
CC BY-SA 4.0
2019-03-25T22:14:06.517Z
2/4: Type `netstat -ab >file.txt` into the Command Prompt, then press return. This is the first command and you do not expect something to happen: the `>file.txt` element tells Windows to save the ordinary output into a file in the current directory called `file.txt`. You're doing this because the ordinary output will overflow the Command Prompt buffer and you'll lose the initial output.
Alistair Mann
CC BY-SA 4.0
2019-03-25T22:14:13.223Z
3/4: Type `notepad file.txt` into the Command Prompt, then press return. This is the second command and you DO expect something to happen. [Microsoft notepad](https://en.wikipedia.org/wiki/Microsoft_Notepad) will appear with the `netstat -ab` output already within it.
Alistair Mann
CC BY-SA 4.0
2019-03-25T22:14:22.667Z
4/4: Using notepad, search on `5040` as described above.
Alistair Mann
CC BY-SA 4.0
2019-03-22T08:14:03.833Z
2019-03-22T08:14:03.833Z
Alistair Mann
<p>looks like 5040 already used, try to use default port or another port </p>

CC BY-SA 4.0
2019-12-18T15:51:24.227Z
2019-12-18T15:51:24.227Z
crybo
<p>This is what my conf file looks like:</p>
<pre><code>prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=user
rpcpassword=password
keypool=10000
server=1

[main]
rpcport=5040
</code></pre>
<p>Whenever I run this from the command line I get the following error:</p>
<blockquote>
<p>Binding RPC on address ::1 port 5040 failed.</p>
<p>Binding RPC on address 127.0.0.1 port 5040 failed.</p>
</blockquote>
<p>I checked for port 5040 using the <code>netstat -a</code> and it was listening, what's the problem?</p>

CC BY-SA 4.0
2019-03-21T23:42:46.550Z
Are you sure nothing else is using port 5040 already?
Raghav Sood
CC BY-SA 4.0
2019-03-21T23:49:34.897Z
Please post the results of running
`sudo lsof -i | grep 5040`
Alistair Mann
CC BY-SA 4.0
2019-03-22T07:10:23.923Z
My OS is Windows 10, not linux
frogman578
<bitcoind><json-rpc>
How do I configure a port in my .conf file?
frogman578
# How do I configure a port in my .conf file?

(Asked by: username_0 on 2019-03-21)

This is what my conf file looks like:

```
prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=user
rpcpassword=password
keypool=10000
server=1

[main]
rpcport=5040

```

Whenever I run this from the command line I get the following error:

> Binding RPC on address ::1 port 5040 failed.
>
> Binding RPC on address 127.0.0.1 port 5040 failed.

I checked for port 5040 using the `netstat -a` and it was listening, what's the problem?

**Tags:** bitcoind, json-rpc

> **Comments:**
> **username_1**: Are you sure nothing else is using port 5040 already?  
> **username_2**: Please post the results of running `sudo lsof -i | grep 5040`  
> **username_0**: My OS is Windows 10, not linux  

---

## 2 answers

### Answer by username_2 on 2019-03-22. Score: 1

> Windows 10

Run `netstat -ab >file.txt` then `notepad file.txt` and search on `5040`. I suspect you will find `CDPSvc` immediately underneath - on my machine this "Connected Devices Platform Service" is already using your port.

If that's so, search on `5041`, then `5042` and continue up until search can't find it. That port is free: change your rpcport to match it.

> **Comments:**
> **username_0**: Nothing happens when I run that command  
> **username_2**: There are two commands.  
> **username_0**: I don't quite understand, could you elaborate more?  
> **username_2**: 1/4: Open up an [Admin Command Prompt](https://superuser.com/a/968225)  
> **username_2**: 2/4: Type `netstat -ab >file.txt` into the Command Prompt, then press return. This is the first command and you do not expect something to happen: the `>file.txt` element tells Windows to save the ordinary output into a file in the current directory called `file.txt`. You're doing this because the ordinary output will overflow the Command Prompt buffer and you'll lose the initial output.  
> **username_2**: 3/4: Type `notepad file.txt` into the Command Prompt, then press return. This is the second command and you DO expect something to happen. [Microsoft notepad](https://en.wikipedia.org/wiki/Microsoft_Notepad) will appear with the `netstat -ab` output already within it.  
> **username_2**: 4/4: Using notepad, search on `5040` as described above.  

---

### Answer by username_3 on 2019-12-18. Score: 1

looks like 5040 already used, try to use default port or another port


---

