Menu
User

DropVPS Team

Writer: John hens

how to set proxy in CentOs 8 command line

how to set proxy in CentOs 8 command line

Publication Date

08/16/2025

Category

Articles

Reading Time

1 Min

Table of Contents

Setting up a proxy on CentOS 8 can be useful when you are behind a corporate network or want to route your internet traffic through a proxy server for privacy and control.

Step 1: Temporary Proxy for Session

You can apply proxy settings that only last until you close the terminal. This is useful for quick testing before making permanent changes:

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

Step 2: Permanent Proxy in Shell Profile

To make the proxy settings persistent across reboots and terminal sessions, add them to your shell:

nano ~/.bashrc

Add the proxy environment variables:

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

Step 3: Set Proxy System-Wide

If you want proxy settings to apply to all users and services, configure them in the /etc/environment file:

sudo nano /etc/environment

Add this line under [main]:

proxy=http://username:[email protected]:8080/

Step 5: Verify Proxy Settings

Finally, confirm that your proxy is working by checking your public IP address with a simple command:

curl ifconfig.me
Linux VPS
U
Loading...

Related Posts

how to set proxy in CentOs 8 command line