Complete setup of Shadowsocks (1)
Installation and setup

This post was auto converted and may contain formatting errors.

This post takes notes of a Complete process of setting up Shadowsocks and Shadowsocks-manager on Ubuntu 16.04.

Preparation

Start from an fresh installed Ubuntu 16.04. First do an update:

sudo apt update
sudo apt upgrade

Install screen

sudo apt install screen

Install Node.js

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt install nodejs

Install Redis

sudo apt install redis-server

Install Shadowsocks. The branch I choose is Shadowsocks-libev. Note that Shadowsocks-manager does not support ShadowsocksR.

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

Install Shadowsocks-manager

npm i -g shadowsocks-manager --unsafe-perm

Setups

Setup Redis

Check installation

redis-server

Set Redis password

redis-cli
> config set requirepass PWD
> auth PWD

Setup Shadowsocks manager

Make a directory for config files

mkdir ~/.ssmgr
cd ~/.ssmgr

Create a type s config file for each proxy server. The address under shadowsocks is the port exposed by the shadowsocks. Here it is 127.0.0.1:6001. The port under manager is used by shadowsocks-manager to listen control command from the master server.

# ss.yml
type: s
shadowsocks:
  address: 127.0.0.1:6001
manager:
  address: 0.0.0.0:6002
  password: 'password'
db: 'db.sqlite'

Create a type m GUI config file for the master server. The address should be the actual IP address of the master server.

# webgui.yml
type: m
manager:
  address: xxx.xxx.xxx.xxx:6002
  password: 'password'
plugins:
  flowSaver:
    use: true
  user:
    use: true
  account:
    use: true
  email:
    use: true
    type: 'smtp'
    username: 'ss_luyan@163.com'
    password: 'password'
    host: 'smtp.gmail.com'
  webgui:
    use: true
    host: '0.0.0.0'
    port: '80'
     site: 'http://ss.yuluyan.com'
    # icon: 'icon.png'
    # skin: 'default'
    # googleAnalytics: 'UA-xxxxxxxx-x'
    # gcmSenderId: '476902381496'
    # gcmAPIKey: 'AAAAGzddLRc:XXXXXXXXXXXXXX'
db: 'webgui.sqlite'
redis:
  host: '127.0.0.1'
  port: 6379
  password: 'PWD'
  db: 0

Run Shadowsocks and Shadowsocks-manager

Use the following command to run them

screen -dmS ssserver ss-manager -m chacha20-ietf-poly1305 -u --manager-address 127.0.0.1:6001
screen -dmS ssmanager ssmgr -c ss.yml
screen -dmS ssgui ssmgr -c webgui.yml

Create another node

Create a similar ss.yml file on the node and configure correspondingly in the portal.