How to setup shadowsocks Proxy on Ubuntu

shadowsocks is a socks5 proxy server. Unlike Most other socks5 proxy software, shadowsocks require client side software installed for socks5 proxy to work.

Installing shadowsocks

This need to be done on server and client.

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

Configuring shadowsocks as server

ssserver is the shadowsocks server. To configure, create file

vi /etc/shadowsocks.json

Put following content in it


In the above, replace your server ip and password. server_port can be changed if you want to use a different port, that is not required.

To start server, run

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

You can stop server using

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

You can verify shadowsocks server is running using netstat

root@hon-vpn:~# netstat -an | grep 8044
tcp        0      0*               LISTEN     
udp        0      0*                          

Log file available at

tail -f /var/log/shadowsocks.log 

Connecting to shadowsocks server

To connect to shadowsocks server, you need to install client. There are many clients available for different operating systems. You can find more details at

shadowsocks come with sslocal command line client.

Configure sslocal to connect to shadowsocks server

Configuring sslocal is same as configuring your server. Create file

sudo vi /etc/shadowsocks.json

With following content

    "local_address": "",

Replace SERVER_IP and SERVER_PASSWORD with what you have in your server configuration.

Now start client with command

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

You can stop sslocal with

sudo sslocal -c /etc/shadowsocks.json -d stop

Above commands run shadowsocks as deamon, if you just want to run for debug purpose, use

sudo sslocal -c /etc/shadowsocks.json

Configuring Browser

You can set your browser to connect using socks proxy, use as your proxy server.

Here is the settings for firefox browser.

Start shadowsocks on boot

Edit /etc/rc.local and add

On server

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

On client

sslocal -c /etc/shadowsocks.json -d start

See Proxy

Posted in Linux