- I cannot open my Unity Project.
- Whenever I open Unity, I get an error saying “Could not establish a connection with the Unity Package Manager local server process".
This error occurs when the Unity Editor starts the Unity Package Manager process, but is not able to communicate with it over the address http://127.0.0.1.
There could be a number of causes, such as HTTP traffic being blocked on this address by a firewall or that HTTP traffic is being re-routed from this address by a proxy.
A proxy server (for example on a corporate network) may be redirecting HTTP traffic from your machine. If the proxy is intercepting traffic on http://127.0.0.1, then the Unity Editor may be unable to communicate with UPM. For this reason, Unity automatically bypasses the proxy for Unity Package Manager requests.
However, in previous Unity versions, the proxy bypass could be overridden using the environment variable NO_PROXY or UNITY_NOPROXY. If you have these variables set, please ensure that their values include 127.0.0.1. For example:
Important: Some users have reported that even without setting the UNITY_NOPROXY variable, Unity could not communicate with UPM and that explicitly setting the variable as below fixed their issue:
Important: Some users have said to ensure both localhost and 127.0.0.1 are present, and localhost is listed first.
For instructions on setting environment variables, see the article 'I need to start Unity with an environment variable(s) set, how can I do that?'
As of the following Unity versions, the proxy bypass behavior can no longer be overridden using environment variables. Unity will always bypass a proxy for connections with UPM:
Unity 2020 - 2020.1.0a24 and up
Unity 2019 - 2019.3.4f1 and up
Unity 2018 - 2018.4.18f1 and up
If you are on an earlier Unity version, please consider upgrading to one of the above versions. This way you can set UNITY_NOPROXY; how you like without worrying about interfering with connections to UPM.
On Windows, there is often a firewall enabled by default called Windows Defender Firewall. This firewall can prevent inbound and outbound HTTP connections for specific applications. For this reason, when installing a Unity Editor via the Unity Hub, the Hub automatically adds a rule to Windows Defender Firewall which allows inbound connections to the Unity Editor:
To view your inbound rules:
1) Control Panel > Windows Defender Firewall > Advanced settings > Inbound Rules
If you see your Unity Editor version is blocked (red circle icon), click “Properties” in the right-hand pane and under “Action”, select “Allow the connection”.
If you do not see a rule for your Unity Editor version, try creating one with the steps below:
1) Click “New Rule…”
2) For “Rule Type”, select “Program”
3) For the program path, enter the complete path to the Unity Editor installation
4) For “Action”, select “Allow the connection”
5) For “Profile”, select all rules (Domain, Private, Public)
6) Give the rule a name, for example “Unity 2019.3.0a1 Editor”
Important: Some users have reported that even with an existing rule for their Unity Editor version, it appears that Windows Defender Firewall is still preventing inbound connections coming from UPM. Some users have found that deleting the existing rule and re-creating it has fixed this.
Unity Hub Suggestions
Unity Hub version 2.2.0 changed the way that environment variables were passed to the Unity Editor. This caused issues for some users since the user's own environment variable values might get overridden. If these were proxy-related environment variables, this may have prevented Unity from connecting to UPM.
Unity Hub version 2.2.2 fixed this issue so that user and system environment variables were preserved when starting the Unity Editor.
If you have an older version of the Unity Hub, please consider upgrading to version 2.2.2 or greater.