Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to setup Shadowsocks on your Ubuntu server

How to setup Shadowsocks on your Ubuntu server

Your school or company network may block the access to a few specific websites. To solve this problem, I'd highly recommend Shadowsocks, since it is the easiest proxy tool I've ever found, and it's FREE (of course iff you have your own server running).

First, ssh to your server, and make sure you have Python and pip installed. If you have Python but not pip, install it using the following command

$ sudo apt-get install python3-pip

Then, install Shadowsocks using pip

$ sudo pip install shadowsocks

Create configuration file at /etc/shadowsocks.json, with the following content,

{
   "server":"[server ip address]",
   "server_port":8388,
   "local_port":0,
   "password":"[password]",
   "timeout":600,
   "method":"aes-256-cfb"
}

Don't forget to change the [server ip address] and [password] in the block above.

Finally, we're ready to start the shadowsocks server that runs in the background by

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

If you wish to stop the Shadowsocks server, do this

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

To install Shadowsocks client software on your local machine, follow the instruction in this repository on GitHub.

Cheers! Now you don't ever need to curse your school or company Internet administrator for blocking your favorite websites anymore.

@yuchenlin

This comment has been minimized.

Show comment
Hide comment
@yuchenlin

yuchenlin Jul 27, 2017

is there any method that does not need sudo?

yuchenlin commented Jul 27, 2017

is there any method that does not need sudo?

@yuchenlin

This comment has been minimized.

Show comment
Hide comment
@yuchenlin

yuchenlin Jul 27, 2017

oh i see, we can specify the pid-file and log-file location manually

yuchenlin commented Jul 27, 2017

oh i see, we can specify the pid-file and log-file location manually

@fazzolini

This comment has been minimized.

Show comment
Hide comment
@fazzolini

fazzolini Sep 17, 2017

/etc/shadowsocks.json needs to be created on the server? What ip address and password do I need to put in? The server's own ip address? And the password should be the one I would like to use on my local machine to connect to the server?

fazzolini commented Sep 17, 2017

/etc/shadowsocks.json needs to be created on the server? What ip address and password do I need to put in? The server's own ip address? And the password should be the one I would like to use on my local machine to connect to the server?

@rtpro

This comment has been minimized.

Show comment
Hide comment
@rtpro

rtpro Nov 28, 2017

You can skip the whole server creation process and just use a service such as ShadowTunnelz https://shadowtunnelz.com/

rtpro commented Nov 28, 2017

You can skip the whole server creation process and just use a service such as ShadowTunnelz https://shadowtunnelz.com/

@StevenMasini

This comment has been minimized.

Show comment
Hide comment
@StevenMasini

StevenMasini Apr 22, 2018

You might need to edit this Gist, but on some Ubuntu instance you might need to install libsodium by running sudo apt-get install libsodium-dev

StevenMasini commented Apr 22, 2018

You might need to edit this Gist, but on some Ubuntu instance you might need to install libsodium by running sudo apt-get install libsodium-dev

@mohamadaliakbari

This comment has been minimized.

Show comment
Hide comment
@mohamadaliakbari

mohamadaliakbari May 7, 2018

Install latest version

pip3 install -U git+https://github.com/shadowsocks/shadowsocks.git@master

shadowsocks/shadowsocks#646 (comment)

mohamadaliakbari commented May 7, 2018

Install latest version

pip3 install -U git+https://github.com/shadowsocks/shadowsocks.git@master

shadowsocks/shadowsocks#646 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment