# How to set proxy with environment variables \`http\_proxy\` and \`https\_proxy\` in a raw terminal environment?

**URL:** https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717
**Category:** Help
**Created:** [February 23, 2023, 10:00am UTC](https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717 "2023-02-23T10:00:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dbsxdbsx](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dbsxdbsx/32/8504_2.png) [@dbsxdbsx](https://discourse.nixos.org/u/dbsxdbsx)
#### Post date: [February 23, 2023, 10:00am UTC](https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717/1 "2023-02-23T10:00:33Z")

</div>

I am using clash for proxy. But when installing Nixos from a raw terminal（the minimal NixOS ISO）, there is no clash or anything installed. Also, due to network issue (that’s why I need a proxy), I can’t download anything. The only thing I have is a subscription URL and many proxy services info fetched from the URL. Then, how to use these to make a proxy so that I can get internet access through proxy in the raw terminal?

I know the common answer is setting http\_proxy or https\_proxy in such format: `http://<proxy_host>:<proxy_port>` or `http://<name>:<password>@<proxy_host>:<proxy_port>` .

The question is, with a specifically selected proxy server, if using `"http://<proxy_host>:<proxy_port>"`, then the response is `curl: (52) Empty reply from server` from `curl google.com`. If taking the latter format, I wonder what the `name` and `password` should be.

---

<div class="post-metadata">

### Author: ![Sandro](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sandro/32/2865_2.png) [@Sandro](https://discourse.nixos.org/u/Sandro)
#### Post date: [February 23, 2023, 11:32pm UTC](https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717/2 "2023-02-23T23:32:38Z")

</div>

see [NixOS Search](https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=networking.proxy)

---

<div class="post-metadata">

### Author: ![dbsxdbsx](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dbsxdbsx/32/8504_2.png) [@dbsxdbsx](https://discourse.nixos.org/u/dbsxdbsx)
#### Post date: [February 24, 2023, 12:54am UTC](https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717/3 "2023-02-24T00:54:29Z")

</div>

Thanks for your attention. But the doc there only tells the format of these env variables, which I did know.  
Generally, if using a proxy app, I would use the format like `http://<LOCALHOST>:<proxy_port>`. But in my case here, there is no proxy app.

---

<div class="post-metadata">

### Author: ![SamLukeYes](https://discourse.nixos.org/user_avatar/discourse.nixos.org/samlukeyes/32/7056_2.png) [@SamLukeYes](https://discourse.nixos.org/u/SamLukeYes)
#### Post date: [February 24, 2023, 3:16am UTC](https://discourse.nixos.org/t/how-to-set-proxy-with-environment-variables-http-proxy-and-https-proxy-in-a-raw-terminal-environment/25717/4 "2023-02-24T03:16:40Z")

</div>

First, please check if [this manual section](https://nixos.org/manual/nixos/unstable/index.html#sec-nix-network-issues) would help. If it doesn’t work in your situation, you can [install NixOS from an existing Linux distribution](https://nixos.org/manual/nixos/unstable/index.html#sec-installing-from-other-distro) where `clash` is already available, or [build a NixOS ISO](https://nixos.org/manual/nixos/unstable/index.html#sec-building-image) with `clash` in `systemPackages`.
