Setting up a Proxy Server on a VPS: A Guide
A reliable proxy server that can provide a secure internet connection for end users can be deployed on a VPS by yourself. A simple and detailed instruction from will help you install it in just a few minutes. For this, we will use the Squid application for the Linux Ubuntu LTS operating system.
Why Squid? This application has everything you need for business:
- Logkeeping function;
- Fast deployment;
- Access control and virus protection;
- Bandwidth monitoring;
- Content filtering;
- Reliable encryption of the connection.
Moreover, the Squid proxy server application can be installed on a VPS with any configuration parameters. This will make it easier to centralize internet traffic in the network for businesses of any scale.
How to Create a Proxy
With this simple guide, you will easily set up a proxy server on a VPS. Follow the steps, and you will succeed.
Logging into the VPS system using Putty
At this stage, you need to set up an SSH connection to the server. Don’t forget that this action requires administrator rights.
Installing Squid
Squid can be found in the Ubuntu repositories. Before you start the installation, make sure that the OS version is updated. For this, enter the following commands in the command line:
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install squid
Tip: Copy the original file — this will be your backup in case something goes wrong:
sudo cp /etc/squid3/squid.conf.default
Restricting Access
One of the most common mistakes beginners make when setting up a proxy server on a VPS is to leave it open for anonymous authentication.
The best way to secure your server is to register a free dynamic DNS with your provider. With this service, you can restrict access to the server by creating a whitelist for the IP addresses of your company.
Setting up a Proxy Server Installed on a VPS
First, you need to edit the Squid configuration.
Add the file:
/etc/squid3/squid.conf
And add the following lines:
http_access allow client
acl client src 12.123.123.123# Home IP
Replace the word “client” with your hostname, and 12.123.123.123 with your website’s IP address.
In the case of dynamic DNS, this step will need to be repeated several times. In this case, you can use srcdomain instead of src and the hostname of the dynamic DNS service to provide access.
Restart and Check
After applying these settings, restart Squid:
service squid3 start
Try pinging the server or connecting to it from a remote network.
Adding a Proxy Server on a VPS in Browsers
For the Windows environment, you will need to create a Group Policy Object. This will enforce the use of IP addresses and ports assigned to Squid by internet browsers.
Note: The default port is 3128.
Checking the Connection
Go to Google and enter your IP address. The response often appears on the search engine results page. If everything went well, you will see the IP address you entered, not the IP address of your internet provider.
How to Run a Proxy for Specific Websites
To run a proxy server that you have already installed on a VPS for specific websites, use the popular FoxyProxy extension. The intuitive interface does not require separate instructions. You will need to:
- Click “Add New Proxy” in the settings;
- Go back to Putty and look up the port number and IP address;
- Enter them in the corresponding fields in the “Details” tab;
- In the “URL Patterns” tab, add masks for the websites you need (don’t forget about the * symbols on both sides of the mask).
How to Save a Session
To save the current session without constantly starting Putty:
- Open PuTTy, go to the Connection section, and then the Data tab;
- Assign the name Root;
- Give a name to your session and save it in the Sessions tab.
Now, the proxy server installed on the VPS. To start working with it you just need to enter your password – all session parameters will be saved in the list.
If you don’t want to waste your time for setup by your own, you can rent a VPS with preinstalled proxy server.
This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.
This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.