Deploy Shadowsocks on a VPS
Get your own encrypted proxy running in under 20 minutes with this step-by-step guide.
- Basic terminal/command line knowledge
- A credit card for domain + VPS rental
Architecture Overview
Before we begin, here is what we are building. Every component serves a specific purpose in making your traffic invisible to censors and ISPs:
graph TD
A["Your Device"] -->|"HTTPS :443"| B["Nginx"]
B -->|"WebSocket"| C["Shadowsocks :8389"]
C -->|"Normal Traffic"| D["Internet"]
style A fill:#1e293b,stroke:#3b82f6,color:#e2e8f0
style B fill:#1e293b,stroke:#f59e0b,color:#e2e8f0
style C fill:#1e293b,stroke:#10b981,color:#e2e8f0
style D fill:#1e293b,stroke:#8b5cf6,color:#e2e8f0
- Nginx listens on port 443 with a genuine SSL certificate, handling TLS termination. To any observer, your server looks like a normal HTTPS website.
- Shadowsocks runs inside a Docker container on port 8389 (localhost only). Nginx forwards WebSocket traffic from the
/shadowsockspath to this container. - v2ray-plugin wraps the Shadowsocks protocol inside WebSocket frames, so the entire chain is: your device → TLS → WebSocket → Shadowsocks → internet.
The result: your ISP sees standard HTTPS traffic to what appears to be an ordinary website. There is nothing to detect or block.
Step 1: Get a Domain Name
You need a domain name for your proxy server. This is essential — it allows you to get a real SSL certificate, which makes your traffic look like normal HTTPS browsing. Without a domain, firewalls can easily identify and block your server by IP.
A domain costs as little as $2-9 per year. Choose any registrar you like:
Namecheap — Affordable domains with free privacy protection.
- Go to namecheap.com and search for a domain
- Choose a cheap TLD (
.uk,.xyz,.siteare often under $3/year) - Add WhoisGuard (free) to hide your personal information
- Complete the purchase
- Go to Domain List → your domain → Advanced DNS to manage DNS records later
Cloudflare Registrar — Domains at wholesale cost, no markup.
- Create an account at cloudflare.com
- Go to Domain Registration → Register Domain
- Search for a domain and purchase (
.comis ~$9/year at cost) - DNS is automatically managed by Cloudflare — no extra setup needed
Porkbun — Low prices, free WHOIS privacy and SSL included.
- Go to porkbun.com and search for a domain
- Many TLDs are available under $5/year
- WHOIS privacy is included free with every domain
- Complete the purchase and manage DNS from the dashboard
Step 2: Choose a VPS Provider
You need a virtual private server (VPS) – a small cloud computer that will run your Shadowsocks proxy 24/7. The cheapest tier from any major provider is more than sufficient.
DigitalOcean – Reliable, beginner-friendly, servers in 15+ regions.
- Sign up at digitalocean.com
- Click Create Droplet
- Choose Ubuntu 24.04 LTS as the operating system
- Select the $4/month plan (512 MB RAM, 1 vCPU) – this is more than enough
- Choose a region close to you (e.g., London, Frankfurt, New York)
- Under Authentication, select SSH Key (recommended) or Password
- Click Create Droplet and note the IP address
Vultr – Competitive pricing, 32 server locations worldwide.
- Sign up at vultr.com
- Click Deploy New Server
- Choose Cloud Compute (Regular Performance)
- Select Ubuntu 24.04 LTS
- Choose the $3.50/month plan (512 MB RAM, 1 vCPU)
- Pick a server location close to you
- Add your SSH key or set a root password
- Click Deploy Now and note the IP address
Hetzner – Excellent value, EU-based, strong privacy.
- Sign up at hetzner.com/cloud
- Create a new project, then click Add Server
- Choose Ubuntu 24.04 as the image
- Select CX22 (2 vCPU, 4 GB RAM, approximately EUR 4/month) or the cheapest available
- Choose a location (Falkenstein, Nuremberg, Helsinki, or Ashburn)
- Add your SSH key
- Click Create & Buy Now and note the IP address
OVH – Budget-friendly, EU-based, good for privacy-conscious users.
- Sign up at ovhcloud.com
- Navigate to Public Cloud → Create an instance
- Choose Ubuntu 24.04 as the image
- Select the Starter tier (approximately EUR 3.50/month)
- Choose a region (Gravelines, Strasbourg, London, etc.)
- Add your SSH key
- Launch the instance and note the IP address
Step 3: Point Your Domain to the Server
You need a domain name pointed at your VPS so that you can get a genuine SSL certificate. This is what makes your traffic look like normal HTTPS browsing.
- Log in to your domain registrar (Namecheap, Cloudflare, GoDaddy, etc.)
- Go to the DNS settings for your domain
- Create an A record:
- Name/Host:
@(or a subdomain likeproxy) - Value/Points to: your VPS IP address (e.g.,
203.0.113.42) - TTL: Automatic or 300 seconds
- Name/Host:
Step 4: Connect to Your Server via SSH
Open a terminal on your computer and connect to your VPS:
ssh root@YOUR_SERVER_IP
Replace YOUR_SERVER_IP with the IP address from Step 1. If you set a password instead of an SSH key, you will be prompted to enter it.
ssh command above. Alternatively, you can use PuTTY if you prefer a graphical interface.Once connected, you should see a command prompt like root@your-server:~#. You are now ready to set up the server.
Step 5: Install Docker
Docker lets us run Shadowsocks in an isolated container. Install it with a single command:
curl -fsSL https://get.docker.com | sh
This downloads and runs Docker’s official installation script. It works on Ubuntu, Debian, CentOS, and Fedora. The process takes about a minute.
Verify that Docker is installed and running:
docker --version
You should see output like Docker version 27.x.x, build ....
Step 6: Deploy the Shadowsocks Container
Now deploy the Shadowsocks server with v2ray-plugin support:
docker run -d \
--name shadowsocks \
--restart always \
-p 127.0.0.1:8389:8389 \
-e PASSWORD=YOUR_STRONG_PASSWORD \
-e METHOD=aes-256-gcm \
jfca68/shadowsocks-server:latest
YOUR_STRONG_PASSWORD with a strong, unique password. Use at least 16 characters with a mix of letters, numbers, and symbols. This password is what encrypts your traffic – treat it like a bank password.Let us break down what this command does:
-d– Run the container in the background (detached mode)--name shadowsocks– Give the container a memorable name--restart always– Automatically restart if the container or server reboots-p 127.0.0.1:8389:8389– Expose port 8389 only on localhost (not to the public internet)-e PASSWORD=...– Set the encryption password-e METHOD=aes-256-gcm– Use AES-256-GCM encryption (the strongest available)
Verify the container is running:
docker ps
You should see a container named shadowsocks with status Up.
Step 7: Install and Configure Nginx
Nginx will act as a reverse proxy, accepting HTTPS connections on port 443 and forwarding WebSocket traffic to the Shadowsocks container.
Install Nginx:
apt update && apt install -y nginx
Create the Nginx configuration file for your domain:
nano /etc/nginx/sites-available/YOUR_DOMAIN
Paste the following configuration (replace YOUR_DOMAIN with your actual domain):
server {
listen 80;
server_name YOUR_DOMAIN;
location /shadowsocks {
proxy_pass http://127.0.0.1:8389;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
return 200 'Welcome to my website';
add_header Content-Type text/plain;
}
}
Enable the site and restart Nginx:
ln -s /etc/nginx/sites-available/YOUR_DOMAIN /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
location / block serves a simple text response for anyone who visits your domain directly. This makes it look like a normal, innocuous web server. You can replace this with a static HTML page if you prefer.Step 8: Get an SSL Certificate
A genuine SSL certificate from Let’s Encrypt is critical. It ensures your traffic uses real TLS encryption and that your server looks like a legitimate HTTPS website.
Install Certbot and obtain a certificate:
apt install -y certbot python3-certbot-nginx
certbot --nginx -d YOUR_DOMAIN
Certbot will:
- Verify that you control the domain
- Obtain a free SSL certificate from Let’s Encrypt
- Automatically configure Nginx to use HTTPS
- Set up automatic certificate renewal (certificates expire every 90 days, but Certbot renews them automatically)
When prompted, enter your email address (for renewal notifications) and agree to the terms of service. When asked about redirecting HTTP to HTTPS, select Yes (option 2).
Step 9: Test Your Setup
Verify the server
Visit https://YOUR_DOMAIN in a web browser. You should see:
- A valid SSL certificate (padlock icon in the address bar)
- The “Welcome to my website” text (or whatever you configured)
Configure your client
Now set up the Shadowsocks client on your device. You will need these details:
| Setting | Value |
|---|---|
| Server | YOUR_DOMAIN |
| Server Port | 443 |
| Password | The password you set in Step 5 |
| Encryption | aes-256-gcm |
| Plugin | v2ray-plugin |
| Plugin Options | tls;host=YOUR_DOMAIN;path=/shadowsocks;mux=0 |
Verify the connection
Once connected through your Shadowsocks client:
- Visit whatismyipaddress.com – you should see your VPS’s IP address, not your real one
- Visit dnsleaktest.com and run the extended test – no DNS queries should point to your real ISP
- Run a speed test at speedtest.net – you should see minimal speed reduction
What’s Next?
Your Shadowsocks proxy is now running. Here are some next steps:
- Connect all your devices – Set up the client on Windows, macOS, Linux, Android, and iOS
- Learn more about Shadowsocks – Understand how the technology works and why it is resistant to censorship
- Set up automatic updates – Keep your Docker image up to date:
docker pull jfca68/shadowsocks-server:latest
docker stop shadowsocks && docker rm shadowsocks
# Re-run the docker run command from Step 5