Skip to main content

Setup Your Own Shadowsocks Server On Debian, Ubuntu, CentOS

shadowsocks server

Shadowsocks is an open source socks5 proxy that can be used to bypass firewall and unblock websites. Originally developed by a Chinese called clowwindy on Github, now the application has been implemented in all kinds of programming languages such as C, C++, Go, Python and the like. This Tutorial will guide you through setting up your own Shadowsocks server and how to use it on your desktop computer, android and iOS. I assume you already have access to a VPS or dedicated server.

Shadowsocks VS VPN

As you may already know, you can use VPN (Virtual Private Network) to bypass firewall and protect your anonymity on the web. Do you need another software like shadowsocks to do the same? One thing you can find is that When you are using VPN, all your Internet traffic is routed through VPN. Because VPN servers are usually located outside your country, this can slow down your Internet speed especially when you are visiting websites inside your country.

Shadowsocks comes to the rescue! Besides a global proxy setting, shadowsocks can also be setup in a way that some of your applications go through shadowsocks and other applications go through normal traffic. For example, you can use Google Chrome to bypass firewall, visit Google, Facebook, YouTube and use Firefox to visit sites that isn’t blocked in your area.

By the way, shadowsocks client will automatically reconnect to shadowsocks server if there’s a disconnect. Although you can configure VPN client to do the same, but that will take extra work.

Setting Up Shadowsocks on Your Server

There are many ways to install shadowsocks on Linux server, but I will show you the easiest way.

First install python pip and then use pip to install shadowsocks. m2crypto will make encryption a little faster


sudo apt-get install python-pip python-m2crypto
sudo pip install shadowsocks


sudo yum install m2crypto python-setuptools
sudo easy_install pip
sudo pip install shadowsocks

Create a configuration file:

sudo vi /etc/shadowsocks.json

Put the following text into the file.


Explanation of each field:

  • server:  your hostname or server IP (IPv4/IPv6).
  • server_port:  server port number.
  • local_port:  local port number.
  • password:  a password used to encrypt transfer.
  • timeout:  connections timeout in seconds.
  • method:  encryption method, “bf-cfb”, “aes-256-cfb”, “des-cfb”, “rc4”, etc. Default is table, which is not secure. “aes-256-cfb” is recommended.

Replace the green text with your info. Save and close the file, then start shadowsocks server.

sudo ssserver -c /etc/shadowsocks.json -d start

To stop shadowsocks server:

sudo ssserver -d stop

Restart Shadowsocks server:

sudo ssserver -c /etc/shadowsocks.json -d restart

Check Shadowsocks log

less /var/log/shadowsocks.log

If necessary, you can always manually download the python version from

You may need to allow traffic through your Shadowsocks server port in iptables firewall by running command: sudo iptables -I INPUT -p tcp --dport 8000 -j ACCEPT

Auto Start on System Boot

If you want shadowsocks server to automatically start on system boot, then edit /etc/rc.local file

sudo vi /etc/rc.local

Add the following line to the file above exit 0 line

/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start

Install and Configure Shadowsocks Client on Desktop Linux

Ubuntu users install it from PPA

sudo add-apt-repository ppa:hzwhuang/ss-qt5

sudo apt-get update

sudo apt-get install shadowsocks-qt5

Fedora/RHEL users can install it from Copr Repository

sudo dnf copr enable librehat/shadowsocks

sudo dnf update

sudo dnf install shadowsocks-qt5

There’s a shadowsocks-qt5 package in AUR repository, so Arch users can use yaourt package manager to install it.

sudo yaourt -S shadowsocks-qt5

Mac and Windows users refer to this page for downloading shadowsocks client.

Configure Shadowsocks Client

Once downloaded and installed on your computer, open it. And right click on the blank background, choose add and then manually to manually add a profile.


In the Profile Editor Window, give your profile a name. Then enter the following information as specified in the /etc/shadowsocks.json file on your server. Once it’s done, click OK button to save the profile.


Back in the connection manager window, choose you newly added profile and click connect on the upper-left corner.


Now your shadowsocks client is connected to your server. Next we will tell Firefox and chrome to use your shadowsocks client.

Configure Firefox And Google Chrome to Use Shadowsocks

Open up Firefox, and in the menu bar, choose Edit and then Preferences. And then click the Advanced tab. choose network and then settings.


In the connection settings window, choose manual proxy configuration and then on the socks host field enter, enter 1080 in the port field. Be sure to choose socks v5 as the socks type. And finally click the OK button.


Now your firefox can visit google, youtube and other blocked sites!

For Google Chrome users, there’s a plugin called SwitchyOmega that you can install on Chrome. Once installed the plugin, open its options page, add a profile. Then edit your profile as follows. Save the profile and you are done. Now you can visit those blocked sites!


Install Shadowsocks on Android and iOS

Android client download

iOS client download link

Speed Optimization

The most important factor here is your server location and Internet speed of your ISP.  For example, I live in China and have shadowsocks server located in the United States. Although my server has fast connection to, but because the speed between me and my server is slow, so the overall speed between me and is slow.

The solution is that I rented another VPS located in Hong Kong and built a shadowsocks server on it. The speed between me and the server in HK is fast and HK server has fast connection to, so I can now view Youtube videos in 720p without hiccups.

Rate this tutorial
[Total: 11 Average: 3.9]