Menu
User

DropVPS Team

Writer: John hens

How to set proxy in Debian 12 command line

How to set proxy in Debian 12 command line

Publication Date

08/16/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Setting a proxy in Debian 12 allows you to route your system’s internet traffic through a designated server, which can help with network restrictions, security, and accessing resources behind a firewall.

Step 1: Check Current Proxy Settings

Before making changes, it’s useful to verify whether any proxy is already configured on your system. This helps prevent conflicts with new settings:

echo $http_proxy
echo $https_proxy

Step 2: Set Temporary Proxy

Set a proxy for the current terminal session; it will last until the terminal is closed:

export http_proxy="http://username:[email protected]:8080/"
export https_proxy="http://username:[email protected]:8080/"

Step 3: Make Proxy Persistent

To keep the proxy active across terminal sessions, add it to your shell profile so it loads automatically:

nano ~/.bashrc

Then add:

export http_proxy="http://username:[email protected]:8080/"
export https_proxy="http://username:[email protected]:8080/"

Step 4: Configure APT Proxy Settings

APT requires its own proxy settings to download packages. You need to edit the APT configuration file:

sudo nano /etc/apt/apt.conf.d/95proxies

Then add the following lines to enable APT to use the proxy:

Acquire::http::Proxy "http://username:[email protected]:8080/";

Step 5: Verify Proxy Settings

To ensure your traffic goes through the proxy server, run an IP check command:

curl ifconfig.me

 

Linux VPS
U
Loading...

Related Posts