Easy Ways To Set Up A Proxy Server On Linux For Free

A proxy server plays a critical role in a business network. It helps detect and prevent attacks targeted on internal networks by malicious people. A proxy server also acts as an intermediary between your web server and visitors. All their requests and responses from the web server pass through the proxy server.

If you’re surfing on unsecured Wi-Fi or looking to hide your activity, it will help if you know how to set up a proxy server. This tutorial will guide you on the best ways to set up a proxy server on Linux. It will help make the setup quick and straightforward.

Here’s all the information you need.

How to Set Up Proxies Temporarily on Linux

There are several options to consider when setting up proxies on your network. One thing you need to consider is whether you’ll be using the proxy all the time. Not many people like using proxies always unless there’s something pushing them.

If you want to use a proxy for a specific short-term purpose, the best thing will be to set up a temporary one. Once you’ve fulfilled your needs, you can then drop it and keep browsing with your actual IP address. This section will look into how you can set up a proxy for temporal use on Linux.

1. Setting Proxies That Do Not Require Login Credentials

If you ever asked yourself what’s the most straightforward proxy to set up on Linux, here’s the answer. Proxies that do not require log-in usernames and passwords are very easy to set up. You need a specific server IP and port to fully set up this proxy.

But then, proxies of this type aren’t the safest to use especially for organizations with sensitive data. The IP authentication feature they come with cannot guarantee enough protection. That is if it is the primary means of authentication.

There are only steps that you need to follow to set up this type of proxy. The first thing is to check the dashboard that the provider gives you and whitelist your device’s IP address. Here’s a command that you can use to set up a proxy server temporarily:  

# export http_proxy=http://SERVER:PORT/

2. Setting Proxies with Log-in Credentials

The next type of proxy server you can set up on Linux requires log-in credentials. The difference between the two lies in the security levels that they guarantee. A proxy server with log-in credentials is safer than one that doesn’t require such details.

Setting up this type of proxy isn’t very different from the one without log-in credentials. You only need the username and password, then tweak the method used earlier a bit. Modifying the link used earlier to accommodate a username and password will help you get there.

The main thing to do is confirm that you have the proper credentials to log into the proxy. If they are right, you are one step closer to setting up your proxy server. Here’s the command for this process: 

# export http_proxy=http://USERNAME:PASSWORD@SERVER:PORT/

3. Setting Proxies with Domain

Some proxies require domain details before they get set up on Linux. It is easy to install this proxy if you have the needed details. You only need to modify the same code used above to set your proxy server. Here’s the modified command for this purpose: 

# export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/

4. Handling @ Character in Password

Setting up your proxy server is different if your password has @ as a character. Check out the command for this process and note the difference from the rest. 

# export http_proxy=http://DOMAIN\USERNAME:P@SSWORD@SERVER:PORT/

You should be careful not to omit the (/) just before @ as many people forget to include it and find setting the proxy server difficult.

How to Set Up Permanent Proxies on Linux

As explained earlier, you can use a temporary or permanent proxy. The different methods discussed above will help you set up a temporary proxy server on Linux. But then, if you use your proxy all the time, the best thing is setting it up permanently, so you’re good to go anytime.

We use the environment variable to set up permanent proxies. You modify the command used for temporary proxies to look like this: 

# echo “http_proxy=http://proxy.example.com:3128/” >> /etc/environment

The main difference between this and other commands is the introduction of /etc/environment to introduce the environment variable you’ll use to set up your permanent proxy.

Proxy Settings Verification

The next step after setting up your proxy server is verifying the settings. You need to confirm that you have set up the proxy server successfully, and the settings will work well with your PC. The verification process here is easy because Linux provides an easy way to do it.

Some commands will help you determine whether you have got a proxy server set on Linux. You can either use # echo $http_proxy or # echo $https_proxy. Pay attention to the values that these commands should get you. If there are no values, then the setup wasn’t successful.

Although the proxy setup was successful, you need to confirm that the browser recognizes it. As mentioned earlier, the default settings that proxies come with may not be helpful. Your browser may overlook them and make the proxy server you set up entirely useless.

Thankfully, there’s how to check whether the proxy server is working. Click on this link to know the IP address you’re using to access the internet. That will help you know if you’re accessing the internet using a real or fake IP address then take necessary action.

The software you use may also make your proxy server not work as expected. It is vital to confirm how the software works before expecting the proxy server to work. Some software disregards the global proxy settings that the server you set up comes with from the provider.

If you can’t set up a proxy, then think about what you’re looking to do. Although residential proxies play so many roles on a network, you may not need them if privacy is your primary concern. You can purchase a VPN and use it to browse anonymously. 

Use a proxy when you need more than online privacy. It is perfect for preventing unauthorized access to a network, stopping a data breach, controlling internet access, etc.

Conclusion

Knowing how to set up a proxy server can significantly benefit your organization. The process may look intimidating at first, but this tutorial will help you get through it. It contains lots of invaluable tips that will help you secure your network, browse anonymously, and prevent unauthorized access.

As we’ve seen above, you only need a command to set up your proxy server on Linux. The commands depend on your needs and the type of proxy you’re looking to set up. We’ve provided all the commands that you need to set up proxies on your Linux machine.

It is also worth noting that the proxy server you set up may not work straight away. It would be best if you took your time to confirm it is working before you start transferring any data. Also, be sure that the applications and software you’re using can recognize and work perfectly with the proxy server.