I'm getting an error when trying to access my Droplet with P4V.

Posted February 1, 2020 2.3k views

I’m getting an error when trying to access my Droplet with P4V or any Perforce software. It is as follows: Connect to server failed; check $P4PORT. TCP connect to [Droplet IP Address]:1666 failed. connect: [Droplet IP Address]:1666: WSAECONNREFUSED. It seems the droplet is refusing my access, which is weird because when I set up perforce with puTTY, I don’t get rejected. Any ideas on troubleshooting this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi Davidtveraas,

Remember that P4PORT not only specifies the port you connect to but also the host. This can be mildly confusing from time to time.

First check that your environment variable P4PORT is set to “devel:1666” (or “YourIP:1666” which one is more appropriate):

Windows: "set P4PORT"
unix: "echo $P4PORT"

If not, you have to set it

Windows: "set P4PORT=devel:1666"
unix (bash): "export P4PORT=devel:1666"

and then try to connect, for example using “p4 info”, to verify.

I’m not sure what OS you are running but if it is WinXP then I should also have a look at the built-in firewall. If that one is enabled you might as well have a block on port 1666 since that one is a non-standard port from a windows perspective.

Have a nice day.


  • I am using Windows 10.

    Where do I enter the P4V command “set P4PORT” or “set P4PORT=devel:1666”?

    I tried to enter it into my console and I still get the same results when trying to connect via P4V. It also says “p4: command not found” when I try p4 info.

    • Sorry that I haven’t used Windows as my servers,so it’s better to submit a work-ticket for DigitalOcean’s help team or go to other forums like StackOverflow,create a new post to look for help.

      Have a nice day.


      • Thanks for the help anyway.

        I was able to figure out how to get p4 info to work. But I only get a Connect to server failed; check $P4PORT. error again.

        I’ll try other sources.