Setup A Shadowsocks Server on DigitalOcean

Shadowsocks is an open-source SOCKS5 proxy which, according to their official site, is designed to protect your internet traffic. As an expat in China, I have tried a few VPN services. The major downside of well-known providers is that their VPNs create one connection for all traffic (which is easier for China’s GFW to detect/block/slow down).

Recently, I tested Shadowsocks on an Ubuntu server based in Singapore and I must say I’m quite happy with SOCKS5 rather than the paid services. I know there are a bunch of tutorials out there on how to configure Shadowsocks. But, I’d like to be more precise providing the best tips and workarounds.

In this tutorial, you’ll learn how to install Shadowsocks and related packages on an Ubuntu server and bypass the Great Firewall of China. I’ve recently tested the script and packages in 2022, and it still works flawlessly.

Prerequisites

  1. A DigitalOcean droplet (preferably an Ubuntu or CentOS x64 server) / Cost: Starts from $5 per month. Feel free to sign-up with my referral link if you’re interested. Which should give you $100 credit for 60 days.
  2. Notepad++/Sublime Text Editor if you don’t prefer UNIX vi editor.
  3. SFTP/FTP client like WinSCP or Transmit for macOS if you prefer a GUI.

How To Create A New Droplet In DigitalOcean

Note: I highly recommend new users to generate/set-up SSH keys while creating a droplet as they provide a more secure way of logging into a virtual private server with SSH than using a password alone.

Screenshot showing the creation of a droplet on DigitalOcean.com

How To Install Shadowsocks on Ubuntu 21.10

Let’s fire up putty or any other SSH client and log in to your server as root user.

Screenshot represents 16.0. But the script would work fine on all new Ubuntu versions above 16.10 yakkety.

Once you have logged in to the server, run the following command to update the packages:

apt-get update

Now, run the following commands to install Shadowsocks:

 sudo apt install shadowsocks-libev

After finishing up the steps above, we must create a .json file (config file) for Shadowsocks. In order to do this, fire up Vi editor or open your text editor and create a new file. Add these data to the file:

{
"server":"your_droplet's_IP_address",
"server_port":8000,
"local_port":1080,
"password":"your_password",
"timeout":600,
"method":"aes-256-cfb"
}

You can choose any encryption method from here.

Save the file as /etc/shadowsocks-libev/config.json.

Now restart your Shadowsocks service. Run the following command to do so:

sudo systemctl restart shadowsocks-libev
sudo systemctl status shadowsocks-libev

Now you’re ready to roll.

Shadowsocks Clients:

Check out the clients for different platforms listed on Shadowsock’s official website.

Donate

Support if you’d like by referring my resume or donating.