Shadowsocks is a secure socks5 proxy that is designed to protect your Internet traffic. The protocol is known for its ability to bypass firewalls and to provide enhanced privacy. In this blog post, we will walk you through the steps required to set up a Shadowsocks server on an Ubuntu system.

Prerequisites

Before you begin, make sure you have the following:

  • An Ubuntu server with a non-root user and sudo privileges.
  • A registered domain name, or the IP address of your server.
  • Basic knowledge of terminal commands and SSH.

Step 1: Update Your System

Start by updating your package index using the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Shadowsocks-libev

Shadowsocks-libev is a lightweight, efficient implementation of Shadowsocks. Install it by following these steps:

  1. Install Software Properties:

    sudo apt install software-properties-common -y
    
  2. Add Universe Repository (if it’s not added):

    sudo add-apt-repository universe
    
  3. Install Shadowsocks-libev:

    sudo apt update
    sudo apt install shadowsocks-libev -y
    

Step 3: Configure Shadowsocks

After installing Shadowsocks-libev, you need to configure it to work with your requirements.

  1. Create a Shadowsocks Configuration File:

    Write the configuration settings in a JSON file, typically located in /etc/shadowsocks-libev/config.json:

    sudo nano /etc/shadowsocks-libev/config.json
    

    Add the following configuration replacing your_password and your_preferred_port:

    {
       "server":"0.0.0.0",
       "server_port":your_preferred_port,
       "local_port":1080,
       "password":"your_password",
       "timeout":600,
       "method":"aes-256-gcm"
    }
    
  2. Save and Close the File: Press CTRL + X, then Y and hit Enter to save.

Step 4: Start and Enable Shadowsocks Service

To ensure that Shadowsocks runs at startup and starts now, execute:

sudo systemctl start shadowsocks-libev
sudo systemctl enable shadowsocks-libev

Step 5: Configure Firewall (Optional)

If you are using ufw (Uncomplicated Firewall) as your firewall, make sure to allow traffic for the configured port:

sudo ufw allow your_preferred_port/tcp
sudo ufw allow your_preferred_port/udp

Verify that the port is open:

sudo ufw status

Conclusion

Congratulations! You have successfully set up a Shadowsocks server on your Ubuntu system. You now have a secure and efficient proxy ready to use. You can connect to it using a compatible Shadowsocks client on your desktop or mobile device. Remember to always keep your server updated to ensure the security and performance of your setup.

For more configurations, such as configuring multiple users or customizing encryption methods, please refer to the official Shadowsocks documentation. Happy browsing!