How to Create SOCKS5 Proxy on Ubuntu VPS

Basically proxies have a lot of uses. It is not only used to protect privacy related to IP addresses, but is also often used to perform research data on the internet and also web scrapping.

Proxies are also distinguished from several types. There are HTTP, HTTPS, SOCKS4, and SOCKS5. All of that have a difference separate from the functionality. And in this article, I want to share about a tutorial on how to create a proxy with the easiest SOCKS5 type to do.

It’s almost the same as management Squid Proxyit’s just that I think it’s even simpler, because basically there aren’t many settings that need to be adjusted.

Tutorial on Making SOCKS5 Proxy on Ubuntu

This method can actually also be applied to the Debian OS. Nothing wrong with trying. And here, I’m using Ubuntu version 16.04 and a package called Dante for the proxy creation. Please just follow the steps below.

1. Install Dante

Actually you can directly install Dante via APT, it’s just that the version you get is not the latest one. But I highly recommend to install the latest versionso please use the following command to start installing it.

sudo apt update
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
sudo apt-get install gdebi-core -y
sudo gdebi dante-server_1.4.1-1_amd64.deb

Installation process using help gdebi. And if in the end a red message appears, that’s not a problem considering the configuration hasn’t been set up correctly. So please proceed to the second step to set the configuration.

2. Configure Dante

Only a few configurations you can set, such as authentication and port. Immediately following the command to go to the Dante configuration file:

nano /etc/danted.conf

Each option has a comments as a guide, just like arranging Squid Proxy. An example of the settings I use is as follows:

# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.unprivileged: nobody

# The listening network interface or address.
internal: 0.0.0.0 port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
socksmethod: username

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

You can set it however you want, and the settings above will make Dante run on 1080 ports. In addition, the proxy will also require a username and password to be able to use it. If you want to remove the authentication and want to make it a public proxy, please set it socksmethod as none.

Also read: How to Setting Proxy in Linux Terminal

Run Dante and SOCKS5 Proxy Test

Now that the configuration is set, you can run it with this command:

service danted start

And to know the status of whether Dante is running correctly, use the following command:

service danted status

If the red notification does not appear, it means that Dante has been running normally. And now it’s time to test whether SOCKS5 Proxy can be used. Please use the command below:

curl -v -x socks5://user:[email protected]<ALAMAT_IP>:1080 http://www.google.com/

Please change some of the things above, including the username, password, and the IP address of the server that is used as a proxy. Unless you set the proxy as public, then please omit the user and password sections.

If code HTML from the Google website appears on the terminal, it means the proxy is working fine. And now you can use the proxy for various things. Either used in the browser, or used in a program.

Hopefully useful and good luck