# Set proxy only for package installation

**URL:** <https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554>\
**Category:** Package Management\
**Tags:** package\
**Created:** [February 10, 2026, 12:46pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554 "2026-02-10T12:46:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigori74](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rodrigori74/32/220761_2.png) [@rodrigori74](https://discourse.julialang.org/u/rodrigori74)\
**Post date:** [February 10, 2026, 12:46pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/1 "2026-02-10T12:46:16Z")

</div>

Hi,  
my company works behind a proxy and, for security reasons, we have our registry hosted in an internal bitbucket server.  
Package installation from github works fine with the proxy set in the ‘startup.jl’ file.  
But we need to limit the scope of that configuration so that packages go via proxy and code calls don´t (i.e. HTTP.request(get,..)).  
Is there a way to configure the proxy only for the package download from github?  
Best regards,  
Rodrigo

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [February 10, 2026, 1:39pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/2 "2026-02-10T13:39:05Z")

</div>

Here is one possible way. In order to get `Pkg` to download via HTTP proxy, you should put the the following two lines in your `~/.julia/config/startup.jl` file.

```julia-auto
ENV["HTTP_PROXY"] = "<proxy>"
ENV["HTTPS_PROXY"] = "<proxy>"

```

This will set a **global** proxy, but then it looks like it is possible to set the proxy for [HTTP.jl](https://juliaweb.github.io/HTTP.jl/stable/client/#proxy) differently. If you change their code example to be an empty string, maybe that would work to disable the proxy.

```julia-auto
resp = withenv("http_proxy" => "") do
    HTTP.request(:GET, url)
end

```

I have not tested this, so YMMV. Also, you would probably need to disable the proxy for other web packages individually (e.g. Downloads.jl).

Another option would be to simply set the above variables only when you are planning to add/update packages. You could even make a little update script to run once and a while.

```julia-auto
import Pkg

ENV["HTTP_PROXY"] = "<proxy>"
ENV["HTTPS_PROXY"] = "<proxy>"

Pkg.update()

```

Others may have better solutions, but that is all I can think of

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 10, 2026, 2:03pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/3 "2026-02-10T14:03:29Z")

</div>

This needs a bit more context why you need to install packages from GitHub rather than through Julia’s package servers. (There are a number of possible reasons but understanding which ones apply would make it easier to give advice.)

---

<div class="post-metadata">

**Author:** ![rodrigori74](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rodrigori74/32/220761_2.png) [@rodrigori74](https://discourse.julialang.org/u/rodrigori74)\
**Post date:** [February 10, 2026, 2:24pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/4 "2026-02-10T14:24:32Z")

</div>

Thanks but I need to provide a solution valid for my company users, so they don´t access internet via proxy. Telling them to disable it via code is not possible.

---

<div class="post-metadata">

**Author:** ![rodrigori74](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rodrigori74/32/220761_2.png) [@rodrigori74](https://discourse.julialang.org/u/rodrigori74)\
**Post date:** [February 10, 2026, 2:35pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/5 "2026-02-10T14:35:36Z")

</div>

Regarding GitHub access. Julia registry is hosted in github ( [GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General) ), and each package within the registry is pointing to its corresponding package project in github as well.  
For instance, this is the content of Pluto’s Package.toml in the General registry:

> Blockquote

name = “Pluto”  
uuid = “c3e4b0f8-55cb-11ea-2926-15256bba5781”  
repo = “[https://github.com/fonsp/Pluto.jl.git”](https://github.com/fonsp/Pluto.jl.git%E2%80%9D)

> Blockquote

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 10, 2026, 3:01pm UTC](https://discourse.julialang.org/t/set-proxy-only-for-package-installation/135554/6 "2026-02-10T15:01:41Z")

</div>

The default way to install packages and the General registry (unless you have a really old Julia version) is through package servers, with GitHub installations as a fallback if the package servers fail.

Presumably your proxy blocks [https://pkg.julialang.org](https://pkg.julialang.org) and the easiest solution would be to unblock it, which would only give access to public Julia packages, artefacts, and the General registry. Then there should be no need to download packages from GitHub.
