Shadowsocks is a lightweight, high-performance SOCKS5 proxy designed to protect privacy and bypass network filtering. While Shadowsocks on its own already encrypts traffic, pairing it with an obfuscation plugin such as simple-obfs greatly reduces the risk of detection by DPI (Deep Packet Inspection) systems and makes traffic appear as innocuous HTTP/TLS. This guide walks through a practical, step-by-step configuration of Shadowsocks with the obfs-plugin on both server and client, including installation, configuration files, systemd integration, firewall adjustments, testing, and troubleshooting tips suitable for site operators, enterprise admins, and developers.
Prerequisites and environment assumptions
Before proceeding, ensure you have the following:
- A Linux server (Ubuntu 20.04/22.04 or CentOS 7/8) with root or sudo privileges.
- Basic familiarity with the command line and systemd.
- Shadowsocks-libev and simple-obfs available in the package repository or buildable from source.
- A client device supporting plugin options (shadowsocks-libev client, Shadowsocks-Qt5, or mobile apps that expose plugin fields).
Overview of the obfuscation approach
Obfuscation works by wrapping the encrypted Shadowsocks payload in a layer that mimics common protocols. The most common options provided by simple-obfs are:
- obfs=http — makes traffic look like generic HTTP requests.
- obfs=tls — makes traffic resemble TLS/HTTPS handshakes.
These modes can be further customized with headers such as a fake Host (obfs-host) for the http mode or with specific client behavior for tls. The obfs plugin runs as a separate process (obfs-local on the client, obfs-server on the server) and is invoked through the Shadowsocks --plugin and --plugin-opts parameters.
Installing Shadowsocks-libev and simple-obfs
On Debian/Ubuntu:
- Update packages:
sudo apt update && sudo apt install -y shadowsocks-libev simple-obfs
On CentOS (EPEL may be required):
- Enable EPEL and install:
sudo yum install epel-release && sudo yum install -y shadowsocks-libev simple-obfs
If your distribution does not have simple-obfs in the repo, you can build from source:
- Install build deps (libevent, autoconf, automake, libtool, etc.).
- Clone the repo:
git clone https://github.com/shadowsocks/simple-obfs.git - Build and install:
cd simple-obfs && git submodule update --init --recursive && ./autogen.sh && ./configure && make && sudo make install
Server configuration (shadowsocks + obfs-server)
Create a Shadowsocks JSON config (example at /etc/shadowsocks-libev/config.json):
{
"server":"0.0.0.0",
"server_port":8388,
"password":"YourStrongPassword",
"method":"chacha20-ietf-poly1305",
"timeout":300,
"fast_open":false,
"nameserver":"8.8.8.8"
}
To enable obfuscation you will not change this file, but you will start ss-server with the plugin flags. Example systemd service is provided below to run both Shadowsocks and the obfs-server plugin through the plugin mechanism exposed by shadowsocks-libev.
Systemd service example for the server
Create /etc/systemd/system/ss-obfs.service with the following content (adjust paths and user as needed):
[Unit]
Description=Shadowsocks-libev server with simple-obfs
After=network.target
User=nobody
ExecStart=/usr/bin/ss-server -c /etc/shadowsocks-libev/config.json --plugin obfs-server --plugin-opts "obfs=http;obfs-host=www.bing.com"
Restart=on-failure [Install] WantedBy=multi-user.target
Notes:
- Use obfs=http or obfs=tls depending on your needs.
obfs-hostsets the fake Host header for HTTP mode — choose a stable public host (e.g.,www.bing.comor a domain you control).
Enable and start the service:
sudo systemctl daemon-reloadsudo systemctl enable --now ss-obfs.service
Client configuration (ss-local + obfs-local)
On the client, configure a local Shadowsocks instance that uses obfs-local as a plugin. Example command-line:
ss-local -s server.example.com -p 8388 -l 1080 -k "YourStrongPassword" -m chacha20-ietf-poly1305 --plugin obfs-local --plugin-opts "obfs=http;obfs-host=www.bing.com"
Or using a JSON config (e.g., ~/.config/shadowsocks-libev/config.json):
{
"server":"server.example.com",
"server_port":8388,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"YourStrongPassword",
"method":"chacha20-ietf-poly1305"
}
Then start with plugin options using command line or a service wrapper. If you use a GUI client, find the plugin field and set the equivalent options. Common fields to set in clients:
- Plugin:
obfs-local(or path to obfs-local binary) - Plugin options:
obfs=http;obfs-host=www.bing.comorobfs=tls
Firewall and network considerations
Open the port used by the server (8388 in examples). On UFW:
sudo ufw allow 8388/tcp- Optionally, allow UDP if using UDP relay features:
sudo ufw allow 8388/udp
On firewalld (CentOS):
sudo firewall-cmd --permanent --add-port=8388/tcp && sudo firewall-cmd --reload
If you run a reverse proxy or CDN in front of your server, be careful: obfs tls mode mimics TLS handshakes — using a real TLS termination on the same port may confuse traffic. For most setups, it’s simpler to let obfs listen on its dedicated port and avoid other services on that port.
Testing and verification
Basic connectivity test using curl via the local SOCKS5 proxy:
curl --socks5-hostname 127.0.0.1:1080 https://ifconfig.me— validates that outbound traffic flows through Shadowsocks.
Check logs for plugin processes (server):
journalctl -u ss-obfs -fto view runtime logs from the systemd service.
Capture a packet sample to confirm obfuscation behavior (tcpdump):
sudo tcpdump -i eth0 -nn -s 0 -w /tmp/ss-obfs.pcap port 8388- Open the pcap in Wireshark and inspect the payload — for obfs=http you should see HTTP-like headers or requests instead of raw Shadowsocks frames.
Troubleshooting common issues
Connection fails immediately
- Ensure server port and IP are reachable:
telnet server.example.com 8388. - Verify matching passwords, cipher method, and plugin options both sides. Plugin-mode mismatches (client uses http, server uses tls) will fail.
Plain Shadowsocks works but obfs does not
- Confirm
obfs-localandobfs-serverbinaries are installed and executable. - Check that the plugin options string is correctly formatted:
obfs=http;obfs-host=www.example.com. Semicolons separate key/value pairs.
Connection is slow or unstable
- Switch cipher to a faster option like
chacha20-ietf-poly1305which is faster on modern CPUs and mobile devices. - Monitor CPU usage on the server: heavy obfuscation and crypto can add overhead.
- Consider enabling TCP Fast Open on both server and client if supported (
fast_open=truein config) to reduce handshake latency.
Advanced considerations and security notes
Do not rely solely on obfs for security. Obfuscation hides protocol signatures but does not replace strong encryption and proper operational security. Use robust ciphers (AEAD ciphers like chacha20-ietf-poly1305 or aes-256-gcm), rotate passwords when necessary, and monitor logs for anomalies.
Obfs works best when combined with other evasion techniques:
- Use domain-fronting alternatives cautiously — many CDNs no longer support domain fronting.
- Run the server on non-standard ports and pair obfs-host with frequently reachable domains to blend traffic patterns.
Performance trade-offs:
- Obfuscation adds CPU and latency overhead. Test different modes and ciphers to find the best balance.
- In high-throughput scenarios consider provisioning CPU-optimized instances or using a lightweight proxy in front for connection multiplexing.
Maintaining and automating deployments
For professional environments and multiple servers, consider automating the following:
- Use configuration management (Ansible, Salt, Puppet) to keep Shadowsocks and plugin versions synchronized and configuration files consistent.
- Automate certificate renewal if you integrate real TLS on other services and maintain clear port separation between obfs and TLS-terminated services.
- Implement monitoring (Prometheus + node_exporter) and log aggregation (ELK stack) to detect traffic anomalies and system issues.
By combining Shadowsocks with an obfs-plugin such as simple-obfs, you gain an effective second layer of defense against protocol fingerprinting and automated blocking. Proper installation, mirrored configuration on client and server, systemd integration for reliability, firewall configuration, and systematic testing are the pillars of a robust deployment. Remember to periodically review your cryptographic choices and operational practices to maintain privacy and performance.
For more guides, tools, and enterprise-grade deployment recommendations, visit Dedicated-IP-VPN at https://dedicated-ip-vpn.com/.