Install required Ubuntu packages
apt update
apt install -y --no-install-recommends gettext build-essential autoconf libtool libpcre3-dev asciidoc xmlto libev-dev libc-ares-dev automake libssl-dev gawk debhelper init-system-helpers pkg-config apg zlib1g-dev libudns-dev libsodium-dev libmbedtls-dev haveged
Install Certbot
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Get a certificate for your domain :
sudo certbot certonly --standalone
result
# Certificate is saved at: /etc/letsencrypt/live/example.com/fullchain.pem
# Key is saved at: /etc/letsencrypt/live/example.com/privkey.pem
Download shadowsocks-rust
wget https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.17.1/shadowsocks-v1.17.1.x86_64-unknown-linux-gnu.tar.xz
tar -xf shadowsocks-v1.17.1.x86_64-unknown-linux-gnu.tar.xz
Or download latest version here https://github.com/shadowsocks/shadowsocks-rust
Download v2ray-plugin
wget https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.2/v2ray-plugin-linux-amd64-v1.3.2.tar.gz
tar -xzvf v2ray-plugin-linux-amd64-v1.3.2.tar.gz
Or download latest version here https://github.com/shadowsocks/v2ray-plugin
Move files
mv sslocal ssserver ssurl ssmanager ssservice v2ray-plugin_linux_amd64 /usr/local/bin/
Configuration
mkdir -p /etc/shadowsocks
touch /etc/shadowsocks/config.json
nano /etc/shadowsocks/config.json
{
"server":"0.0.0.0",
"server_port":443,
"password":"password",
"mode":"tcp_only",
"timeout":300,
"method":"chacha20-ietf-poly1305",
"plugin":"v2ray-plugin_linux_amd64",
"plugin_opts":"server;tls;cert=/etc/letsencrypt/live/example.com/fullchain.pem;key=/etc/letsencrypt/live/example.com/privkey.pem;host=example.com;path=/;loglevel=none",
"nameserver":"1.1.1.1"
}
replace example.com
with your domain in configuarion
Create Systemd service
touch /lib/systemd/system/shadowsocks.service
nano /lib/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks Server Service
After=network.target
[Service]
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/config.json
ExecReload=/bin/kill -HUP \$MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl enable shadowsocks.service
systemctl start shadowsocks.service
journalctl -u shadowsocks.service -f
References
https://github.com/M3chD09/shadowsocks-with-v2ray-plugin-install