# Install packages behind the proxy

**URL:** <https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 19, 2019, 9:13am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298 "2019-04-19T09:13:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ni\_ck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ni_ck/32/8044_2.png) [@ni\_ck](https://discourse.julialang.org/u/ni_ck)\
**Post date:** [April 19, 2019, 9:13am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/1 "2019-04-19T09:13:18Z")

</div>

Hi everyone!  
I try to use Julia in my current job. But have trouble with installing packages behind the proxy.  
I use 1.1.0 binaries.  
error massage:  
julia\> Pkg.add(“IJulia”)  
Cloning default registries into `~/.julia`  
Cloning registry from “[GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General.git)”  
ERROR: failed to clone from [GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General.git), error: GitError(Code:ERROR, Class:Net, curl error: Unsupported proxy ‘[https://proxy.osmp.ru:3128](https://proxy.osmp.ru:3128)’, libcurl is built without the HTTPS-proxy support.  
)  
Stacktrace:  
[1] pkgerror(::String) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120  
[2] #clone#3(::String, ::Base.Iterators.Pairs{Symbol,LibGit2.CachedCredentials,Tuple{Symbol},NamedTuple{(:credentials,),Tuple{LibGit2.CachedCredentials}}}, ::Function, ::String, ::String) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/GitTools.jl:111  
[3] (::getfield(Pkg.GitTools, Symbol(“#kw##clone”)))(::NamedTuple{(:header, :credentials),Tuple{String,LibGit2.CachedCredentials}}, ::typeof(Pkg.GitTools.clone), ::String, ::String) at ./none:0  
[4] (::getfield(Pkg.Types, Symbol(“##87#89”)))(::LibGit2.CachedCredentials) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1103  
[5] shred!(::getfield(Pkg.Types, Symbol(“##87#89”)), ::LibGit2.CachedCredentials) at ./secretbuffer.jl:184  
[6] clone\_or\_cp\_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}, ::String) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1102  
[7] clone\_or\_cp\_registries at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1087[inlined]  
[8] clone\_default\_registries() at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1037  
[9] find\_registered!(::Pkg.Types.EnvCache, ::Array{String,1}, ::Array{Base.UUID,1}) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1312  
[10] registry\_resolve!(::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:949  
[11] #add\_or\_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:47  
[12] #add\_or\_develop at ./none:0 [inlined]  
[13] #add\_or\_develop#14 at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:31 [inlined]  
[14] #add\_or\_develop at ./none:0 [inlined]  
[15] #add\_or\_develop#13 at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:29 [inlined]  
[16] #add\_or\_develop at ./none:0 [inlined]  
[17] #add\_or\_develop#12(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::String) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:28  
[18] #add\_or\_develop at ./none:0 [inlined]  
[19] #add#20 at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:59 [inlined]  
[20] add(::String) at /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:59  
[21] top-level scope at none:0

---

<div class="post-metadata">

**Author:** ![tkluck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkluck/32/15769_2.png) [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Post date:** [April 19, 2019, 2:41pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/2 "2019-04-19T14:41:37Z")

</div>

Many corporate proxies actually work over HTTP, not HTTPS; your communication is still secure because proxied https traffic uses the `CONNECT` method and the TLS handshake is still handled between the client and upstream server (i.e. without proxy interception).

So unless your employer has told you otherwise, it’s worth checking whether setting the `https_proxy=http://proxy.osmp.ru:3128` works for you.

PS. If you have issues with command-line applications and proxies, [this project may be for you](https://github.com/tkluck/pac4cli).

---

<div class="post-metadata">

**Author:** ![felipenoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felipenoris/32/553_2.png) [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Post date:** [April 19, 2019, 2:53pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/3 "2019-04-19T14:53:12Z")

</div>

Yes, I agree with @tkluck.

You can add these lines to `~/.julia/config/startup.jl` , which will execute on each new Julia session:

```julia
ENV["HTTP_PROXY"] = "http://proxy.osmp.ru:3128"
ENV["HTTPS_PROXY"] = "http://proxy.osmp.ru:3128"

```

---

<div class="post-metadata">

**Author:** ![ni\_ck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ni_ck/32/8044_2.png) [@ni\_ck](https://discourse.julialang.org/u/ni_ck)\
**Post date:** [April 20, 2019, 2:28am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/4 "2019-04-20T02:28:43Z")

</div>

Thanks for the fast reply. I have the opportunity to use a proxy without https. I try to use your advice with startup.jl, before that I erase all proxy env vars, but Julia still finds proxy [https://proxy.osmp.ru:3128](https://proxy.osmp.ru:3128) somewhere. And error still the same.

---

<div class="post-metadata">

**Author:** ![felipenoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felipenoris/32/553_2.png) [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Post date:** [April 21, 2019, 10:22pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/5 "2019-04-21T22:22:29Z")

</div>

Can you execute this line just before trying to add a package and paste the result here?

```julia
println(ENV["HTTP_PROXY"]); println(ENV["HTTPS_PROXY"])

```

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [May 15, 2019, 6:14pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/6 "2019-05-15T18:14:50Z")

</div>

I have a similar issue with installing packages behind a proxy. But in my case it’s not complaining about HTTPS proxies or whatever, it’s just trying to direct connect and failing (which is expected if it tries to direct connect)

I’m using the Debian testing packages: Julia 1.0.3+dfsg-4

I have all the right ENV settings:

```julia

julia> ENV["HTTP_PROXY"]
"http://pico.lan:3128"

julia> ENV["http_proxy"]
"http://pico.lan:3128"

julia> ENV["HTTPS_PROXY"]
"http://pico.lan:3128"

julia> ENV["https_proxy"]
"http://pico.lan:3128"

```

I try to Pkg.add(“StatsBase”) but rather than complaining about anything related to the proxy, it actually just tries to direct connect, which isn’t possible:

```julia
julia> Pkg.add("StatsBase")
   Cloning default registries into /home/dlakelan/.julia/registries
   Cloning registry General from "https://github.com/JuliaRegistries/General.git"
e[?25le[?25hERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:OS, failed to connect to github.com: Connection timed out)
Stacktrace:
 [1] pkgerror(::String) at /build/julia-wJr69F/julia-1.0.3+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:120
...

```

Thoughts?

---

<div class="post-metadata">

**Author:** ![Paulo\_Jabardo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulo_jabardo/32/3196_2.png) [@Paulo\_Jabardo](https://discourse.julialang.org/u/Paulo_Jabardo)\
**Post date:** [May 16, 2019, 10:45am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/7 "2019-05-16T10:45:49Z")

</div>

I think you need to configure the proxy on the .gitconfig file

Try adding

```julia
[http]
        proxy = http://pico.lan:3128

```

In my case it works

**EDIT**

I just tried disabling both lines and the package manager is still working. I think there is some other issue. A colleague of mine is experiencing the same problem. I will try to dig deeper.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [May 16, 2019, 2:54pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/8 "2019-05-16T14:54:39Z")

</div>

Git works fine without that line, but I put it in anyway, and Julia has the same results… 🤨

Ok, I tried just git cloning the JuliaRegistries/General.git by hand, and then after that it seemed to work, so something about the initial getting of the registries is different from getting individual packages!

Further useful info: I installed the 1.1.0 binaries from [julialang.org](http://julialang.org) instead of the Debian packages, and they seem to behave better. So probably the solution is to use newer Julia.

---

<div class="post-metadata">

**Author:** ![Wawvi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wawvi/32/8373_2.png) [@Wawvi](https://discourse.julialang.org/u/Wawvi)\
**Post date:** [July 26, 2019, 8:33am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/9 "2019-07-26T08:33:37Z")

</div>

Thanks, this answer solved the problem for me.

---

<div class="post-metadata">

**Author:** ![bocc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bocc/32/7546_2.png) [@bocc](https://discourse.julialang.org/u/bocc)\
**Post date:** [November 4, 2019, 6:25am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/10 "2019-11-04T06:25:38Z")

</div>

Hello,

I wanted to add one more thing, should anyone encounter this problem. You can handle even authenticated proxies by adjusting the global .gitconfig or using a tool like CNTLM. But in my case, CNTLM didn’t solve the problem of downloading binaries (most trivial example would be Plots, which involves downloading .zip files).  
This was worked around by using a [slightly modified](https://github.com/ChristianKurz/BinaryProvider.jl/commit/e67b99ee60a69ef45cc2a180376fc4d1eebe5930) BinaryProvider.jl. I’m not sure how this fork will be kept updated, for the moment it works.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 4, 2019, 6:29am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/11 "2019-11-04T06:29:21Z")

</div>

It looks like that change was merged in July:

[https://github.com/JuliaPackaging/BinaryProvider.jl/pull/168/files](https://github.com/JuliaPackaging/BinaryProvider.jl/pull/168/files)

and should be part of the released versions from then.

---

<div class="post-metadata">

**Author:** ![bocc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bocc/32/7546_2.png) [@bocc](https://discourse.julialang.org/u/bocc)\
**Post date:** [November 4, 2019, 6:46pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/12 "2019-11-04T18:46:56Z")

</div>

I didn’t notice it, but this is great news, thank you!

---

<div class="post-metadata">

**Author:** ![Cypress\_Bai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cypress_bai/32/11756_2.png) [@Cypress\_Bai](https://discourse.julialang.org/u/Cypress_Bai)\
**Post date:** [December 8, 2019, 3:45pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/13 "2019-12-08T15:45:49Z")

</div>

if you are using proxy, add these two lines to **C:\Julia\etc\julia\startup.jl** file:

```julia
ENV["HTTP_PROXY"] = "http://127.0.0.1:your port"
ENV["HTTPS_PROXY"] = "http://127.0.0.1:your port"

```

---

<div class="post-metadata">

**Author:** ![quantum\_lv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quantum_lv/32/13831_2.png) [@quantum\_lv](https://discourse.julialang.org/u/quantum_lv)\
**Post date:** [April 8, 2020, 11:41am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/14 "2020-04-08T11:41:44Z")

</div>

I set the environment as this and still meet this problem.  
Does this fixed your problem

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/a/2a11289893214fdfd2b07acb45dc3b3c02470614.png)

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [April 8, 2020, 11:55am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/15 "2020-04-08T11:55:26Z")

</div>

On Debian Buster I had to set the _Git_ proxy in `/etc/gitconfig`

```julia
[http]
	proxy = http://<proxyserver>:<proxyport>/

```

The important part is to not leave out the trailing slash on this line!  
[https://github.com/JuliaLang/julia/issues/33111](https://github.com/JuliaLang/julia/issues/33111)

You will also need to set the http"s" proxy.

---

<div class="post-metadata">

**Author:** ![quantum\_lv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quantum_lv/32/13831_2.png) [@quantum\_lv](https://discourse.julialang.org/u/quantum_lv)\
**Post date:** [April 10, 2020, 1:01am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/16 "2020-04-10T01:01:11Z")

</div>

By doing this, would it solve your problems?

---

<div class="post-metadata">

**Author:** ![GuiAlDuS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guialdus/32/16942_2.png) [@GuiAlDuS](https://discourse.julialang.org/u/GuiAlDuS)\
**Post date:** [August 5, 2020, 2:27pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/17 "2020-08-05T14:27:11Z")

</div>

Hi,  
I’ll like to report that I’m having similar issues when trying to install packages behind a corporate proxy. I’m using Julia 1.5 on Windows 10 and already defined our proxies as given by the IT guys (already have used them on Python and R).  
What seems strange is that one of the errors I get seems to be related with PowerShell:

```julia
ProcessFailedException(Base.Process[Process(`powershell -NoProfile -Command '[System.Net.ServicePointManager]::SecurityProtocol =
    [System.Net.SecurityProtocolType]::Tls12;

```

Any idea of how to overcome this?

Thanks!

---

<div class="post-metadata">

**Author:** ![racinmat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/racinmat/32/11715_2.png) [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Post date:** [August 9, 2020, 12:47pm UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/18 "2020-08-09T12:47:30Z")

</div>

Setting http proxy and https proxy environment variables should do it.  
Also, to install packages, makje sure that `*.pkg.julialang.org` is whitelisted. (the \*. in the beginning is important since the [pkg.julialang.org](http://pkg.julialang.org) redirects you based on your geo location so by this you’re allowing all geological servers).  
The setting of necessary variables can be seen e.g. here in order to make child process in CompatHelper work behind corporate firewall.  
[https://github.com/JuliaRegistries/CompatHelper.jl/blob/master/src/envdict.jl](https://github.com/JuliaRegistries/CompatHelper.jl/blob/master/src/envdict.jl)

---

<div class="post-metadata">

**Author:** ![Xing\_Shi\_Cai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xing_shi_cai/32/14128_2.png) [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Post date:** [October 8, 2024, 11:30am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298/19 "2024-10-08T11:30:46Z")

</div>

I had a similar error:

```julia
(@v1.10) pkg> up
┌ Warning: could not download https://pkg.julialang.org/registries
│ exception = RequestError: ssl_handshake returned - mbedTLS: (-0x7280) SSL - The connection indicated an EOF while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Registry/Registry.jl:69
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.10/Project.toml`
  No Changes to `~/.julia/environments/v1.10/Manifest.toml`

```

It turned out that I have the following environment variables set

```julia
https_proxy=https://127.0.0.1:1081
http_proxy=http://127.0.0.1:1081
all_proxy=socks5://127.0.0.1:1080

```

The problem comes from the extra `s` in `https://127.0.0.1:1081`. Removing it the Julia works fine. No further setting is needed.
