Log inSign up

Deploy a Shadowsocks server with shadowsocks-rust

Download the latest shadowsocks-rust release, place ssserver in /usr/local/bin, generate a key with ssservice genkey -m 2022-blake3-aes-256-gcm, and write a JSON config that listens on one port for TCP and UDP. Run it as a systemd service, open that port, then point sslocal or a mobile client at the server: your apps talk SOCKS5 to the client, and traffic leaves from the VPS address. The shared key is the authentication, so only people holding it can use the proxy.

Topic: VPN and private DNS · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What is Shadowsocks and how does it authenticate?

Shadowsocks is an encrypted SOCKS5 style proxy. A small client runs on your laptop or phone, exposes a local SOCKS5 port, and wraps every connection in an AEAD cipher keyed with a shared secret before sending it to the server. The server decrypts, opens the real connection and returns the data. Packets without the correct key fail the integrity check and are dropped, so the key acts as the login: nobody without it can relay traffic through your server.

This guide uses shadowsocks-rust, the actively maintained implementation. The older C version in the Debian and Ubuntu archives still works but lacks the 2022 cipher family. Examples use the server 198.51.100.24, the IPv6 address 2001:db8:4f2a::24 and port 8388.

How do you install the shadowsocks-rust binaries?

The project publishes static builds for Linux on its GitHub releases page. Ask the API for the newest tag, download the archive and its checksum, verify, and install:

sudo apt update && sudo apt install -y curl jq xz-utils
VER=$(curl -s https://api.github.com/repos/shadowsocks/shadowsocks-rust/releases/latest | jq -r .tag_name)
echo $VER
FILE=shadowsocks-${VER}.x86_64-unknown-linux-gnu.tar.xz
curl -LO https://github.com/shadowsocks/shadowsocks-rust/releases/download/${VER}/${FILE}
curl -LO https://github.com/shadowsocks/shadowsocks-rust/releases/download/${VER}/${FILE}.sha256
sha256sum -c ${FILE}.sha256
sudo tar -xJf ${FILE} -C /usr/local/bin
ssserver --version

The archive contains ssserver, sslocal, ssurl, ssmanager and ssservice. If the checksum step reports a mismatch, delete the files and download again instead of continuing.

Which cipher and key should you use?

Choose 2022-blake3-aes-256-gcm. The 2022 methods require a key of an exact length encoded in base64, add replay protection and are what current clients expect. Generate a key with the bundled tool:

ssservice genkey -m 2022-blake3-aes-256-gcm

The output is a 44 character base64 string. If a client you need does not support the 2022 family, fall back to chacha20-ietf-poly1305 with a long random password from openssl rand -base64 24. Never use the old stream ciphers such as rc4 or aes-cfb, which lack integrity protection.

How do you write the server configuration?

Create a config directory and a JSON file readable only by root. The service reads it at start through systemd credentials:

sudo mkdir -p /etc/shadowsocks-rust
sudo nano /etc/shadowsocks-rust/config.json
{
    "server": "::",
    "server_port": 8388,
    "password": "PASTE-THE-GENERATED-KEY",
    "method": "2022-blake3-aes-256-gcm",
    "mode": "tcp_and_udp",
    "timeout": 300
}

Binding to :: accepts both IPv4 and IPv6 on a default Linux system. Lock down the file:

sudo chmod 600 /etc/shadowsocks-rust/config.json

How do you run ssserver as a service?

A short unit file starts the server at boot with a throwaway system user. Create /etc/systemd/system/shadowsocks-rust.service:

[Unit]
Description=Shadowsocks server
After=network-online.target
Wants=network-online.target

[Service]
DynamicUser=yes
LoadCredential=config.json:/etc/shadowsocks-rust/config.json
ExecStart=/usr/local/bin/ssserver -c %d/config.json
Restart=on-failure
LimitNOFILE=51200
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes

[Install]
WantedBy=multi-user.target

LoadCredential hands the root-only config to the dynamic user without loosening file permissions, and %d expands to the directory where systemd places it. Start it:

sudo systemctl daemon-reload
sudo systemctl enable --now shadowsocks-rust
sudo ss -lntup | grep 8388

Which firewall rules does it need?

Open the chosen port for both TCP and UDP, since UDP relaying carries DNS and voice traffic for many apps:

sudo ufw allow 8388/tcp
sudo ufw allow 8388/udp
sudo ufw status

Unlike a DNS resolver, the port can be reachable from anywhere, because every packet must carry the right key. If your clients come from fixed addresses, still restrict it with sudo ufw allow from 203.0.113.50 to any port 8388 instead; less exposure means fewer probes in the logs. The ufw guide covers numbered rule deletion if you change ports later.

How do you connect and verify the proxy?

On a Linux or macOS client with the same release installed, start a local SOCKS5 listener:

sslocal -b 127.0.0.1:1080 -s 198.51.100.24:8388 -m 2022-blake3-aes-256-gcm -k PASTE-THE-GENERATED-KEY

In a second terminal send a request through it, letting the proxy resolve names too:

curl -x socks5h://127.0.0.1:1080 -sI https://example.net | head -1

A normal HTTP status means the tunnel works. Mobile and desktop apps import an ss:// link, which the server can produce from its own config:

sudo ssurl -e /etc/shadowsocks-rust/config.json

Share that link only over a private channel, because it contains the key. Finally, try sslocal with a wrong key: the curl call must fail.

How do you update, rotate keys and debug?

Updating means repeating the download step with the new tag and restarting the service; the config stays where it is.

sudo systemctl restart shadowsocks-rust
sudo journalctl -u shadowsocks-rust -n 50 --no-pager

To revoke access, generate a new key, replace it in the config, restart, and hand out fresh links. Common issues:

  • Service exits at once: the key has the wrong length for a 2022 method; generate it again with ssservice genkey.
  • Client connects but nothing loads: the client method differs from the server, or the clock is far off (2022 methods reject stale timestamps); check timedatectl.
  • Web works but calls fail: the UDP rule is missing.

Track transfer with usage monitoring, since every proxied byte counts toward the plan allowance.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-1a personal proxy needs little memory1 vCPU, 1 GB RAM, 25 GB NVMe$3.60/mo$43.20 for 12 months
F1-2higher single-core speed for encryption1 vCPU, 2 GB RAM, 64 GB NVMe$7.20/mo$43.20 for 6 months

Questions about Shadowsocks proxy server

Is Shadowsocks a VPN?

Not in the full sense. It proxies apps that use SOCKS5 or that the client captures, rather than routing every packet of the device. For whole-device tunnels use WireGuard.

Can several people share one server?

Yes. The simplest way is one shared key; separate keys per person are possible with ssmanager or multiple server entries on different ports, which lets you revoke one person without affecting others.

Does the server log the sites I visit?

With the default log level it records start-up and errors, not destinations. Your system journal holds those messages only.

Which port should I pick?

Any free high port works. Avoid ports already used by other services on the VPS and keep TCP and UDP on the same number.

Does it run on ARM or other distributions?

Release archives exist for several architectures and the binaries are static, so they run on most Linux systems. This guide covers Ubuntu and Debian on x86_64 images.