New all country working free VPN
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Install Shadowsocks-libev:
sudo apt install shadowsocks-libev -y
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Configure SSH Key-Based Authentication (Highly Recommended): If not already configured by your VPS provider, set up SSH keys and disable password authentication. This significantly enhances security. Refer to your VPS provider’s documentation or standard Linux security guides for detailed instructions. Disable root login over SSH.
Configure Firewall (UFW): Allow SSH and the ports for Shadowsocks (e.g.,
8443 or 443 for v2ray-plugin). If you are using port 443, ensure no other service like a web server is using it.
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 8443/tcp # Or 443/tcp if you plan to use it
sudo ufw enable
Verify firewall status:
sudo ufw status verbose
Step 3: Installing Shadowsocks-libev and v2ray-plugin
We will install shadowsocks-libev from the Ubuntu repositories and manually download the v2ray-plugin binary.
-
Install Shadowsocks-libev:
sudo apt install shadowsocks-libev -y
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Configure SSH Key-Based Authentication (Highly Recommended): If not already configured by your VPS provider, set up SSH keys and disable password authentication. This significantly enhances security. Refer to your VPS provider’s documentation or standard Linux security guides for detailed instructions. Disable root login over SSH.
Configure Firewall (UFW): Allow SSH and the ports for Shadowsocks (e.g.,
8443 or 443 for v2ray-plugin). If you are using port 443, ensure no other service like a web server is using it.
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 8443/tcp # Or 443/tcp if you plan to use it
sudo ufw enable
Verify firewall status:
sudo ufw status verbose
Step 3: Installing Shadowsocks-libev and v2ray-plugin
We will install shadowsocks-libev from the Ubuntu repositories and manually download the v2ray-plugin binary.
-
Install Shadowsocks-libev:
sudo apt install shadowsocks-libev -y
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
-
Create a New User (Optional but Recommended): Avoid using the root user for daily operations. Replace
your_username with a name of your choice.
sudo adduser your_username
sudo usermod -aG sudo your_username
-
Configure SSH Key-Based Authentication (Highly Recommended): If not already configured by your VPS provider, set up SSH keys and disable password authentication. This significantly enhances security. Refer to your VPS provider’s documentation or standard Linux security guides for detailed instructions. Disable root login over SSH.
Configure Firewall (UFW): Allow SSH and the ports for Shadowsocks (e.g.,
8443 or 443 for v2ray-plugin). If you are using port 443, ensure no other service like a web server is using it.
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 8443/tcp # Or 443/tcp if you plan to use it
sudo ufw enable
Verify firewall status:
sudo ufw status verbose
Step 3: Installing Shadowsocks-libev and v2ray-plugin
We will install shadowsocks-libev from the Ubuntu repositories and manually download the v2ray-plugin binary.
-
Install Shadowsocks-libev:
sudo apt install shadowsocks-libev -y
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
In an increasingly interconnected yet geographically segmented digital world, the demand for reliable and secure access to online content and services is paramount. While numerous “free VPN” solutions are advertised, many come with significant compromises in privacy, security, and performance. This guide, crafted by a senior network administrator, dissects the concept of a truly effective, “free” (or rather, highly cost-efficient) VPN solution by detailing the setup of a self-hosted Shadowsocks server with the v2ray-plugin for enhanced obfuscation and resilience.
Table of Contents
-
Introduction to Self-Hosted VPNs
Understanding “Free” VPNs and Our Approach
Prerequisites for Your Personal VPN Server
Step 1: Procuring Your Virtual Private Server (VPS)
Step 2: Initial Server Setup and Security Hardening
Step 3: Installing Shadowsocks-libev and v2ray-plugin
Step 4: Configuring Shadowsocks with v2ray-plugin
Step 5: Starting and Managing the Shadowsocks Service
Step 6: Client Configuration for Your Devices
Best Practices and Security Considerations
Frequently Asked Questions (FAQ)
Introduction to Self-Hosted VPNs
The concept of a Virtual Private Network (VPN) is fundamental for establishing a secure, encrypted connection over a less secure network, such as the internet. While commercial VPN services are prevalent, they often involve a subscription fee and require trusting a third-party provider with your traffic. For users seeking absolute control, enhanced privacy, and the ability to circumvent geo-restrictions or censorship without recurring costs to a service provider, a self-hosted solution offers a superior alternative. This guide focuses on building a robust, high-performance proxy server using Shadowsocks with the v2ray-plugin, a combination renowned for its effectiveness in bypassing sophisticated network filtering.
Understanding “Free” VPNs and Our Approach
The term “free VPN” is often misleading. Commercial “free” VPNs typically monetize users through advertisements, data collection, bandwidth limitations, or by selling user data. Our approach to a “free” VPN involves a minimal, one-time investment in a Virtual Private Server (VPS) and then leveraging open-source software to create a personal, dedicated proxy. This method provides superior security, performance, and privacy compared to most ad-supported free services, effectively making your internet connection “free” from third-party monitoring or throttling beyond the initial VPS cost.
We will implement Shadowsocks, an open-source, encrypted proxy project, specifically designed for bypassing internet censorship. To further enhance its obfuscation capabilities and improve resistance against traffic analysis, we will integrate the v2ray-plugin, which encrypts Shadowsocks traffic within a WebSocket layer, often disguised as TLS traffic over port 443.
Prerequisites for Your Personal VPN Server
-
Virtual Private Server (VPS): A Linux-based VPS instance with a public IP address. Entry-level VPS plans (e.g., from providers like Vultr, DigitalOcean, Linode, AWS Lightsail) are often sufficient and can cost as little as $3-5 per month. Ubuntu Server 22.04 LTS is recommended for ease of installation.
SSH Client: Software to connect to your VPS via SSH (e.g., PuTTY for Windows, Terminal for macOS/Linux).
Basic Linux Command-Line Knowledge: Familiarity with commands like
apt, nano, systemctl, and file permissions.
Domain Name (Optional but Recommended): A custom domain name pointing to your VPS IP address is beneficial for increased obfuscation, especially when using the v2ray-plugin over TLS. While not strictly required, it helps mimic legitimate web traffic.
Step 1: Procuring Your Virtual Private Server (VPS)
Choose a VPS provider and deploy a new instance. When selecting a server location, consider your geographical needs and proximity to the desired content. A server closer to your target content often results in lower latency. For this guide, we assume you have provisioned a VPS running Ubuntu Server 22.04 LTS.
Upon deployment, you will receive an IP address for your server, along with root credentials or an SSH key pair. Ensure you can connect to your server via SSH before proceeding.
Step 2: Initial Server Setup and Security Hardening
After connecting to your VPS via SSH, perform initial setup and security hardening steps:
-
Update System Packages: Ensure your server’s software is up-to-date.
sudo apt update && sudo apt upgrade -y
-
Create a New User (Optional but Recommended): Avoid using the root user for daily operations. Replace
your_username with a name of your choice.
sudo adduser your_username
sudo usermod -aG sudo your_username
-
Configure SSH Key-Based Authentication (Highly Recommended): If not already configured by your VPS provider, set up SSH keys and disable password authentication. This significantly enhances security. Refer to your VPS provider’s documentation or standard Linux security guides for detailed instructions. Disable root login over SSH.
Configure Firewall (UFW): Allow SSH and the ports for Shadowsocks (e.g.,
8443 or 443 for v2ray-plugin). If you are using port 443, ensure no other service like a web server is using it.
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 8443/tcp # Or 443/tcp if you plan to use it
sudo ufw enable
Verify firewall status:
sudo ufw status verbose
Step 3: Installing Shadowsocks-libev and v2ray-plugin
We will install shadowsocks-libev from the Ubuntu repositories and manually download the v2ray-plugin binary.
-
Install Shadowsocks-libev:
sudo apt install shadowsocks-libev -y
-
Download v2ray-plugin: Visit the v2ray-plugin GitHub releases page to find the latest version for Linux (e.g.,
v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz). Replace vX.Y.Z with the latest version number.
cd /usr/local/bin
sudo wget https://github.com/shadowsocks/v2ray-plugin/releases/download/vX.Y.Z/v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo tar -xvzf v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo rm v2ray-plugin-linux-amd64-vX.Y.Z.tar.gz
sudo chmod +x v2ray-plugin
Ensure the v2ray-plugin binary is executable and located in your system’s PATH, or provide the full path in the Shadowsocks configuration.
Step 4: Configuring Shadowsocks with v2ray-plugin
Create a configuration file for Shadowsocks. We’ll use /etc/shadowsocks-libev/config.json.
sudo nano /etc/shadowsocks-libev/config.json
Paste the following configuration. Replace YOUR_SERVER_IP with your VPS’s public IP address, YOUR_PORT with your chosen port (e.g., 8443 or 443), and YOUR_PASSWORD with a strong, complex password. The "plugin-opts" parameter includes your optional domain name (replace your.domain.com) for TLS obfuscation. If you don’t have a domain, you can omit the "host" parameter or set it to an arbitrary value, but using a domain with a valid TLS certificate greatly improves resilience.
{
"server":"YOUR_SERVER_IP",
"server_port":YOUR_PORT,
"local_port":1080,
"password":"YOUR_PASSWORD",
"timeout":300,
"method":"aes-256-gcm",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"tls;host=your.domain.com"
}
"server": Your VPS’s public IP address.
"server_port": The port your Shadowsocks server will listen on. 8443 is a common alternative to 443. If you use 443, ensure no other service (like Nginx or Apache) is using it.
"password": A strong password for connecting to the server. Avoid simple passwords.
"method": The encryption method. aes-256-gcm is recommended for its balance of security and performance.
"plugin": Specifies that v2ray-plugin should be used.
"plugin_opts": Options passed to the v2ray-plugin.
tls: Enables TLS encryption for the WebSocket connection. Highly recommended.
host=your.domain.com: Sets the SNI (Server Name Indication) hostname for TLS. Crucial for masquerading traffic as a legitimate website. If you don’t have a domain, this parameter can be omitted, but the connection might be more easily detected. Ensure your domain points to your VPS IP address.
Save the file by pressing Ctrl+X, then Y, then Enter.
Step 5: Starting and Managing the Shadowsocks Service
Shadowsocks-libev comes with a systemd service file. We need to enable and start it.
-
Restart Shadowsocks-libev service:
sudo systemctl restart shadowsocks-libev
-
Enable Shadowsocks-libev to start on boot:
sudo systemctl enable shadowsocks-libev
-
Check the service status: Ensure it’s running without errors.
sudo systemctl status shadowsocks-libev
If the service fails, check the logs for clues:
sudo journalctl -u shadowsocks-libev
Step 6: Client Configuration for Your Devices
To utilize your new Shadowsocks server, you’ll need a Shadowsocks client on your devices and the v2ray-plugin for client-side obfuscation. The configuration parameters on the client side must mirror those on the server.
Windows Client Setup
-
Download Shadowsocks-Windows (Shadowsocks-Qt5).
Download the v2ray-plugin for Windows (e.g.,
v2ray-plugin-windows-amd64-vX.Y.Z.zip). Extract v2ray-plugin.exe into the same directory as Shadowsocks.exe.
Launch Shadowsocks-Qt5. Right-click the tray icon and select “Servers” -> “Edit Servers…” or “Add Server…”.
Fill in the following details:
-
Server IP: Your VPS IP address
Server Port:
YOUR_PORT (e.g., 8443 or 443)
Password: YOUR_PASSWORD
Encryption: aes-256-gcm
Plugin: v2ray-plugin (Ensure v2ray-plugin.exe is in the same directory)
Plugin Options: tls;host=your.domain.com (If you used a domain on the server, include it here. Otherwise, use tls only.)
Android Client Setup
-
Download the official Shadowsocks Android client and the v2ray-plugin APK. Install both.
Open the Shadowsocks app. Tap the “+” icon to add a new profile.
Select “Manually Setting”.
Fill in the details:
-
Server Address: Your VPS IP address
Server Port:
YOUR_PORT
Password: YOUR_PASSWORD
Encryption Method: aes-256-gcm
Plugin: Select v2ray
Plugin Options: Enter tls;host=your.domain.com (Match server config)
iOS Client Setup
For iOS, paid clients like Shadowrocket, Quantumult X, or Surge are generally recommended due to their comprehensive features and stability. These apps support Shadowsocks with v2ray-plugin.
-
Purchase and install a client such as Shadowrocket from the App Store.
In the app, add a new server. Choose “Shadowsocks”.
Input your server details:
-
Address: Your VPS IP address
Port:
YOUR_PORT
Password: YOUR_PASSWORD
Method: aes-256-gcm
Plugin: Select “v2ray-plugin” or equivalent.
Plugin Params/Options: Enter tls;host=your.domain.com
Best Practices and Security Considerations
-
Regular Updates: Keep your VPS operating system and Shadowsocks components updated to patch vulnerabilities.
Strong Passwords: Always use strong, unique passwords for SSH and your Shadowsocks configuration. Consider using SSH key-based authentication exclusively.
Monitor Usage: Keep an eye on your VPS resource usage and network traffic.
VPS Location: Choose a VPS location that balances proximity for low latency with a jurisdiction that aligns with your privacy requirements.
Legality: Ensure your use of a self-hosted VPN complies with the laws of your jurisdiction and the terms of service of your VPS provider.
Distinguish VPN vs. Proxy: While often used interchangeably, Shadowsocks is technically an encrypted proxy. It generally proxies application-level traffic rather than routing all network traffic at the kernel level like a traditional VPN (e.g., OpenVPN, WireGuard). For most users seeking to bypass restrictions, this distinction is minor, but it’s important for advanced network configurations.
Frequently Asked Questions (FAQ)
-
Q: My Shadowsocks service won’t start, or clients cannot connect. What should I check?
-
A: First, verify the Shadowsocks service status with
sudo systemctl status shadowsocks-libev and review logs using sudo journalctl -u shadowsocks-libev -e. Common issues include incorrect syntax in /etc/shadowsocks-libev/config.json (check for missing commas, typos, or invalid JSON format) or a port conflict. Ensure the configured server_port is open in your firewall (UFW) and not in use by another application. Also, confirm the v2ray-plugin binary is executable and accessible in /usr/local/bin. Finally, double-check that client configuration exactly matches server settings (IP, port, password, encryption method, plugin options).
host parameter?
-
A: While using a domain name with a valid TLS certificate is highly recommended for optimal obfuscation, especially when using port 443, it’s not strictly mandatory. You can omit the
host=your.domain.com part from both the server’s plugin_opts and the client’s plugin options, leaving it as tls only. However, this might make your traffic slightly more detectable to advanced censorship systems, as the SNI field will be absent or default. If you encounter issues without a domain, consider purchasing a cheap domain and pointing it to your VPS.
-
A: Several factors can cause slow speeds.
-
VPS Network Performance: Test your VPS’s network speed from various locations using tools like Speedtest CLI (
curl -sL https://git.io/superspeed | bash) to rule out underlying network issues from your provider.
Geographic Distance: A greater physical distance between your client and VPS server will inherently increase latency and can impact speed. Try a VPS closer to your location or desired destination.
VPS Resources: If your VPS has limited CPU or RAM, high traffic might saturate its resources. Monitor CPU, RAM, and network usage (e.g., with htop or nload). An upgrade to a more powerful VPS might be necessary for multiple users or high-bandwidth activities.
Encryption Method: While aes-256-gcm is efficient, experiment with other methods if available in your client/server to see if performance changes, though this is less likely to be the primary cause.
Local Network Issues: Ensure your local internet connection is stable and performing well before troubleshooting the VPN itself.
-
Q: Can I use this setup for UDP traffic, like online gaming or VoIP?
-
A: Yes, the
"mode":"tcp_and_udp" setting in the Shadowsocks configuration enables UDP forwarding. However, UDP over Shadowsocks via v2ray-plugin can introduce additional latency compared to direct connections or traditional VPNs like WireGuard. For most applications, it functions adequately, but for highly latency-sensitive tasks like competitive online gaming, direct connections are always preferred. Ensure your client also supports UDP forwarding through the Shadowsocks connection.
