Skip to content

Instantly share code, notes, and snippets.

@chenjie
Last active September 23, 2022 07:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenjie/7e6f6c3b9b5c49e2548c413506505cde to your computer and use it in GitHub Desktop.
Save chenjie/7e6f6c3b9b5c49e2548c413506505cde to your computer and use it in GitHub Desktop.
Deploy your own Shadowsocks(R) server with BBR TCP congestion control algorithm in less than 10 steps.

What is Shadowsocks(R)?

It is a fast and secure socks5 proxy designed to protect your Internet traffic. You can learn more here.
Long story short, it is a proxy that is commonly (and secretly) used in mainland China. People use it to access GFW blocked websites, such as Google, Facebook, etc. You can view a more detailed blocked website list here.

ss-diagram
Source: https://tumutanzi.com/archives/13005

What is BBR?

BBR ("Bottleneck Bandwidth and Round-trip propagation time") is a new congestion control algorithm developed at Google. Congestion control algorithms — running inside every computer, phone or tablet connected to a network — that decide how fast to send data. You can learn more here. google-bbr
Source: https://cloudplatform.googleblog.com/2017/07/TCP-BBR-congestion-control-comes-to-GCP-your-Internet-just-got-faster.html

Deploy our own SSR server

Note: The following script is only tested on Debian 8, while ss supports more Unix-like OS such as Linux.

Commands only (Triple click the command -> copy -> paste)

  1. sudo -i && cd
  2. wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/bbr.sh && bash bbr.sh install
  3. Wait and reconnect.
  4. sudo -i && cd
  5. bash bbr.sh start
  6. wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh && chmod +x shadowsocksR.sh && ./shadowsocksR.sh

Detailed version

  1. sudo -i && cd
    Get the root access of the server and change into HOME directory.

  2. wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/YankeeBBR/master/bbr.sh && bash bbr.sh install
    Update the kernel and install Google BBR TCP congestion control algorithm. (Old kernels won't support BBR)
    This script is originally created by Yankee and currently open-sourced on GitHub.
    [Note: English version is available in my another GitHubGist.]

  3. Don't worry. The VPS/VM will reboot, and the kernel will get updated. After waiting for few seconds, reconnect the SSH.

  4. sudo -i && cd
    Get the root access again.

  5. bash bbr.sh start
    Start the BBR algorithm.

  6. wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh && chmod +x shadowsocksR.sh
    Install Shadowsocks(R) server. This script is also open-sourced on GitHub.

  7. ./shadowsocksR.sh
    Let's go folks! Welcome to the real Internet!

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