In the above screenshot, we’ve put an example IP address 192.168.1.100. You’ll have to replace it with your own dedicated datacenter IP address.
Self-Service Dedicated Datacenter Proxies
Specify the following if you purchased Dedicated Datacenter Proxies via the dashboard.
Proxy types: HTTP, HTTPS, or SOCKS5
IP address: ddc.oxylabs.io
Port: 8001
For Self-Service Dedicated Datacenter Proxies, the port indicates the sequential number of an IP address from the acquired list. Check our documentation for more details.
Datacenter Proxies
Proxy types: HTTP, HTTPS, SOCKS5
IP address: dc.oxylabs.io
Port: 8001
For the pay-per-IP subscription method, the port number corresponds to the order of IP addresses in your list. Therefore, port 8001 will use the first IP address. For further information, please check our documentation.
For the pay-per-traffic subscription, port 8001 will randomly select an IP address but will remain consistent for the session duration. You can also specify the proxy's geo-location within the user authentication string, such as user-USERNAME-country-US:PASSWORD, which will connect to a US proxy. Refer to our documentation for more information.
ISP Proxies
Proxy types: HTTP, HTTPS, or SOCKS5
IP address: isp.oxylabs.io
Port: 8001
That’s it! Once you close the Network Proxy window, the changes will automatically be saved, and the system-wide proxy will be activated. Each time you make a web request through a browser or other application, a pop-up window will prompt you to enter the credentials of your Oxylabs proxy user for the session.
Now, time to learn how to set up an Ubuntu proxy server from the terminal.
How to set up a proxy in Ubuntu terminal
There are multiple ways to set up a proxy server on Ubuntu. Let’s begin with temporary proxy settings using proxy environment variables.
Set up temporary proxy for the current terminal session
The temporary proxy will only be active for the current terminal session and will reset to default as soon as we close the terminal or end the terminal session.
First, open a new terminal. You can also use the shortcut “CTRL + ALT + T” which will open a new terminal for you. In the terminal, create two new environment variables using the below commands:
export http_proxy="username:password@pr.oxylabs.io:7777"
export https_proxy="username:password@pr.oxylabs.io:7777"
Make sure there are no spaces between the equal signs and variables. The export command sets new environment variables for the current terminal session. You can verify that the environment variables are active by running it.
This will show all the environment variables including http_proxy and https_proxy that are active in the current session. The string username:password@pr.oxylabs.io:7777 has the format <username>:<password@<server_address>:<port>. Also, we are assuming the proxy username and password are the strings “username” and “password” respectively. You can replace this information with the appropriate one.
For the Shared and Dedicated Datacenter proxies only the server_address and port will change. The rest will remain the same. For example, for Shared Datacenter Proxies, add the following lines of code:
export http_proxy="username:password@dc.pr.oxylabs.io:10000"
export https_proxy="username:password@dc.pr.oxylabs.io:10000"
Once you export these environment variables, the proxy will be activated for all the subsequent commands. We can make sure the proxy is activated by running the below command and checking our IP address:
wget -qO- http://httpbin.org/ip
If you don’t have Wget installed on your computer then, you can also run it using cURL.
Permanently configure proxies for all terminal sessions
The downside of temporarily configuring proxy using environment variables is that you’ll have to do it every time you start a new terminal. You can avoid this redundant work by configuring a permanent proxy for all of your terminal sessions. Depending on which shell you are using we need to modify the shell configuration file.
Step 1 - Open shell configuration using an editor
For the ZSH terminal, the shell configuration file is by default located in the home directory. We can edit this file using vim with the below command:
Instead of vim, you can also use gedit, nano, or any other text editor that you prefer. Also, if you are using Bash instead of ZSH, you’ll have to edit your bash shell configuration file, i.e. ~/.bashrc instead of ~/.zshrc.
Step 2 - Create two new environment variables
At the bottom of this configuration file, you’ll have to define the http_proxy and https_proxy variables:
export http_proxy="username:password@pr.oxylabs.io:7777"
export https_proxy="username:password@pr.oxylabs.io:7777"
The pattern is exactly the same as the temporary proxy. Also, you can modify them for dedicated datacenter or shared datacenter proxies if you want to use those instead of a residential proxy.
Step 3 - Reload the configuration
Now, we can reload the configuration file either by opening a new terminal or by running the following command in the existing terminal:
The proxy will always be active for the current user. The shell configuration file gets loaded every time you open a new terminal. So, the environment variables will be always available for you even if you restart your computer.
If you want to enable it for all users then you will have to append the above two lines in the /etc/environment.
Set up proxy for APT from terminal
APT is the package manager for Debian, Ubuntu & Linux Mint, etc. It works through the use of repositories or special directories that hold collections of software packages that users can install using a simple command. To use a proxy for the APT package manager some additional work is necessary. We’ll have to edit the /etc/apt/apt.conf file. Go ahead, and open it using vim:
Now, add the below lines to activate Oxylabs’ Residential Proxy for APT:
Acquire::http::Proxy "http://username:password@pr.oxylabs.io:7777";
Acquire::https::Proxy "http://username:password@pr.oxylabs.io1:7777";
The next time you install or update your existing applications or packages, APT will use the Oxylabs’ Residential Proxy. You can replace it with shared datacenter proxies or dedicated datacenter proxies, just like we did in the other methods. But don’t forget to set the proper server address and port number. Additionally, replace the username and password with the correct credentials. Otherwise, you will get a 407 Authentication Required Error, which you can fix by following this HTTP 407 Proxy Authentication Required Error guide.
Conclusion
In this integration tutorial, we demonstrated how you can easily configure Oxylabs Residential and Datacenter Proxies in Ubuntu 20.04 LTS. The methods shown above will also work on any other Debian-based Linux Distribution. We also explored various ways of proxy setup using GUI and terminal methods. In case you have any questions regarding the steps needed to set up Oxylabs Proxies in Ubuntu or want to learn more about our solutions in general, you can always reach out to us at support@oxylabs.io.
Please be aware that this is a third-party tool not owned or controlled by Oxylabs. Each third-party provider is responsible for its own software and services. Consequently, Oxylabs will have no liability or responsibility to you regarding those services. Please carefully review the third party's policies and practices and/or conduct due diligence before accessing or using third-party services.