A Shadowsocks server on a VPS: from the app or by hand

The simplest way is to give the app your server's address and password: it logs in over SSH, installs Shadowsocks and gives every device its own key. By hand, the server is installed from the terminal — with shadowsocks-rust or through Outline. Either way you end up with an ss:// key that any Shadowsocks client understands.

Updated

On this page

From the app, in a few minutes

  1. 1

    Rent a VPS

    The cheapest plan with Linux will do: Ubuntu, Debian, Fedora, CentOS, Rocky, AlmaLinux or Arch Linux. After payment the host sends you an IP address, the root login and a password.

  2. 2

    Add the server

    Profiles → Add → “Your own server”. Type the address and password — user root and port 22 are already set. Click “Add the server”.

  3. 3

    Select Shadowsocks

    On the server screen choose Shadowsocks — the install button changes — and click it. The app sets up the server by itself, and this computer's profile appears on its own.

  4. 4

    Hand out keys

    Type a device name, such as “Phone”, and click “Add a device”: a QR code and a link open. Every device has its own key — you can delete it without affecting the others.

By hand with shadowsocks-rust

  1. 1

    Install ssserver

    shadowsocks-rust is a modern Shadowsocks server program. Ready builds are under Releases in the shadowsocks/shadowsocks-rust project on GitHub: take the Linux archive for the server's processor (x86_64 or aarch64) and unpack ssserver into /usr/local/bin.

  2. 2

    Make a key

    For the Shadowsocks 2022 ciphers the password is a base64 key of the right length: 32 bytes for 2022-blake3-aes-256-gcm, 16 for 2022-blake3-aes-128-gcm. openssl rand -base64 32 makes one. For the classic ciphers any long random password will do.

  3. 3

    Write config.json

    For example /etc/shadowsocks-rust/config.json — a JSON object with server (0.0.0.0), server_port (8388, say), method (the cipher) and password (the key). A mode field set to tcp_and_udp turns on UDP too.

  4. 4

    Start the server

    The command is ssserver -c /etc/shadowsocks-rust/config.json. To have the server come back after a reboot, create a systemd service for this command that restarts on failure.

  5. 5

    Open the port

    The port from server_port — over both TCP and UDP: in the server's firewall (with ufw, ufw allow 8388) and in your host's control-panel firewall, if it has one.

Which cipher to choose

  • 2022-blake3-aes-256-gcm or 2022-blake3-aes-128-gcm — the Shadowsocks 2022 ciphers. They protect against replayed packets, and their key is random bytes, not a password. Use them if all your clients understand them.
  • chacha20-ietf-poly1305 — the classic AEAD cipher that almost any client understands, old ones included. Fast on phones and on processors without AES acceleration.
  • aes-256-gcm and aes-128-gcm — AEAD too, fast on processors with AES acceleration, which means almost any server and computer.
  • Old stream ciphers — rc4-md5, aes-256-cfb, chacha20 without ietf-poly1305 and the like — avoid them: they are insecure, and new clients no longer understand them.

The ss:// key and Outline

A Shadowsocks key is an ss:// link: cipher, password, server address and port in one line. In the classic form the cipher and password, joined by a colon, are base64-encoded: ss://base64(cipher:password)@address:port#name. An example for chacha20-ietf-poly1305:

Example
ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpLZDgzaFF4MlZiN21acA@203.0.113.5:8388#my-ss

The 2022 ciphers need no base64: the cipher and key are written as they are, joined by a colon, and the key's +, / and = characters are encoded as in web addresses — %2B, %2F and %3D. After the # comes the name the client shows in its list.

Outline is the same Shadowsocks with a program for handing out keys. Outline Manager shows a command you run on the server: it installs Docker and the Outline server. You then issue keys from the Manager — ordinary ss:// keys. ssconf:// keys are dynamic: services built on Outline hand them out, and with such a link the client downloads the current settings by itself.

In Veli

The app installs Shadowsocks

In Veli: Profiles → Add → “Your own server”, the server's address and password, “Add the server”. Select Shadowsocks and click the install button. If another protocol is already on the server, the “Add a protocol” tile opens the “New protocol” window: Shadowsocks goes alongside without touching the ones already there. The port is written on the server screen under the protocol's name; at the end of the install the app checks it from outside and tells you if it is closed.

“Add a device” gives a QR code and a link for a phone or another computer: every device has its own key, and you can see how much traffic went through it. “Share…” in the server row's menu creates access for another person. You can install the server from a phone too: Add → “Your own server”. A ready ss:// key or an Outline ssconf:// key goes into Profiles → Add.

FAQ

Does Veli install Shadowsocks on my own server?

Yes: “Your own server”, select Shadowsocks — and the app sets up the server over SSH by itself. Every device gets its own key, and one you don't need is deleted without affecting the others.

How is Outline different from Shadowsocks?

Outline is a Shadowsocks server with a handy program for handing out keys. The protocol is the same: ss:// keys from Outline open in any Shadowsocks client, and ssconf:// in clients that understand Outline keys, Veli included.

Why is Shadowsocks sometimes unstable?

It has no recognizable handshake, but on strict networks an unreadable stream is suspicious in itself, and such connections may get cut. Then put VLESS Reality on the same server: it looks like an ordinary website.

Shadowsocks on your server — from the app

Veli installs Shadowsocks on your VPS over SSH by itself and gives each device its own key.