Setup your own VPN server using Shadowsocks on Ubuntu 18.04


Shadowsocks on Ubuntu is a great implementation for you to have your own VPN server setup. In this tutorial, we’re gonna guide you how to install Shadowsocks server on Ubuntu Server step by step.

What is Shadowsocks?

Shadowsocks is a free and open-source encrypted proxy project, widely used in mainland China to circumvent Internet censorship. It was created by a Chinese programmer in 2012.

Why should we use Shadowsocks instead of other solutions like OpenVPN?

Unlike OpenVPN, Shadowsocks is more simple and easy to set up. Shadowsocks creates a Socks5 proxy server instead of SSL/TLS based VPN connection like OpenVPN. You can quickly set it up in just a few minutes.

Install Shadowsocks server on Ubuntu Server

We can install Shadowsocks server using the Package Manager in Ubuntu. If you are using Ubuntu Server 17.04 or later, just simply run following commands:

$ sudo apt-get update
$ sudo apt install shadowsocks-libev 

If you are using Ubuntu 16.04 or older, you will need to add a custom APT repository before installing Shadowsocks.

$ sudo apt install software-properties-common -y
$ sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
$ sudo apt update
$ sudo apt install shadowsocks-libev

The Shadowsocks config file is located at /etc/shadowsocks-libev/config.json. With default content is



  • server: the IP address of the interface that Shadowsocks server will bind to
  • server_port: the port that Shadowsocks server will listen on.
  • local_port: the port that Shadowsocks client will listen on.
  • password: the password for client authentication.
  • timeout: the connection timeout.
  • method: the encryption method.

You might want to update the server IP address and the password. Other values can be left default. Once you update the Shadowsocks config file, let’s restart it.

$ sudo systemctl restart shadowsocks-libev.service

Then check the Shadowsocks service status

$ sudo systemctl status shadowsocks-libev.service

Make sure the application started successfully with Active status. You might see a similar output

If your system firewall is running, you have to allow the port which configured in config.json file above. For example

$ sudo ufw allow 8388

Install Shadowsocks client on your computer

In order to connect to the Shadowsocks server you set up above, you will need to install Shadowsocks client. Shadowsocks client supports several platforms, such as Windows, Linux, Mac OS X, Android, and iOS. Go to Shadowsocks download page to get the latest download link for your platform.

In this tutorial, we’re gonna use Windows as a client. Shadowsocks client is installed and configured as following screenshot

Fill in the Server Addr, Server Port, and Password then click on OK to start the connection. Please pay attention to the Proxy Port which is 1080. This is the port that Shadowsocks client will listen on your computer.

Now start your favorite browser and set up the Socks5 configuration. If you are using Firefox, go to Tool > Option > Network Settings > Settings to set the Socks5 config as below

  • SOCKS Host:
  • Port: 1080
  • Proxy DNS when using SOCKS v5 must be checked.

Click OK to save the browser’s network setting. The verify your Socks5 connection by going to website You will see your public IP address now is the Shadowsocks server’s IP address. It means that you have setup your own VPN connection successfully.


Setup your own VPN server using Shadowsocks on Ubuntu 18.04
4.5 (90%) 6 vote[s]

Write a Comment