Get shadowsocks-rust up and running on your server in less than 60 seconds.
β This script must be run as root.
curl -o ~/shadowsocks_deploy.sh https://raw.githubusercontent.com/FaridZelli/ShadowsocksQuickDeployment/refs/heads/main/shadowsocks_deploy.sh && chmod a+x ~/shadowsocks_deploy.sh && ~/shadowsocks_deploy.sh ; rm -f ~/shadowsocks_deploy.sh
Run the script with the
-uparameter to uninstall.
- Fetches the latest Shadowsocks release for your hardware
- Installs Shadowsocks as a service and provides an optimized default environment for ssserver
- System architecture and C Library detection
- SSH hardening
- Network optimization via sysctl
- Service unit as non-root user
- Interactive Shadowsocks configuration
- Password generation
While this script has only been tested on Ubuntu 24.04, it should work on most Ubuntu/Debian-based distros.
To setup Shadowsocks on your home network, you'll need:
There are generally two ways to approach this:
Modem-Router <---> Pi
β Simple, half-bandwidth, no dongle required
(tap or click to expand)
- Install the latest OpenWrt release on your Raspberry Pi using Raspberry Pi Imager
- If you're on Linux, resize the root filesystem:
# Identify the block device and partition number; e.g. /dev/sdxN
lsblk
# Resize the root partition
cfdisk /dev/sdx
# Update the filesystem
e2fsck -f /dev/sdxN
resize2fs /dev/sdxN
- Directly connect to your Pi using an ethernet cable and login to LuCI at 192.168.1.1
- Configure the LAN Interface to obtain an IP Address from the primary router
- Network > Interfaces > Lan > Edit > Choose "Static Address"
- Change the device to "eth0"
- Set a valid static IPv4 address and your router's IP as the gateway / DNS
- Apply changes and connect the Pi to your router
- If OpenWrt's repositories are blocked, switch to a mirror via:
- System > Software > Configure opkg
- SSH into your Pi as root using the static IP address:
- Run the following commands:
Replace
netcolognewith your desired mirror
read release arch << EOF
$(. /etc/openwrt_release ; echo ${DISTRIB_RELEASE%.*} $DISTRIB_ARCH)
EOF
for feed in passwall_packages passwall_luci passwall2; do
echo "src/gz $feed https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/releases/packages-$release/$arch/$feed" >> /etc/opkg/customfeeds.conf
done
wget -O passwall.pub https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/passwall.pub && opkg-key add passwall.pub
opkg update && opkg remove dnsmasq && opkg install dnsmasq-full kmod-nft-tproxy kmod-nft-socket luci-app-passwall2
- Reboot your Pi, configure Shadowsocks and DoH via Services > Passwall2
- Configure the Raspberry Pi as the default gateway and LAN DNS provider on your router
Modem-Router > Pi > Router
β More flexible, full-bandwidth, harder to setup
(tap or click to expand)
Note: You'll need a USB 3.0 to gigabit ethernet adapter
AX88179 adapters such as the TP-Link UE306 are known to work well
- Install the latest OpenWrt release on your Raspberry Pi using Raspberry Pi Imager
- If you're on Linux, resize the root filesystem:
# Identify the block device and partition number; e.g. /dev/sdxN
lsblk
# Resize the root partition
cfdisk /dev/sdx
# Update the filesystem
e2fsck -f /dev/sdxN
resize2fs /dev/sdxN
- Directly connect to your Pi using an ethernet cable and login to LuCI at 192.168.1.1
- Configure the LAN Interface to obtain an IP Address from the modem-router
- Network > Interfaces > Lan > Edit > Choose "Static Address"
- Change the device to "eth0"
- Set a valid static IPv4 address and your modem-router's IP as the gateway / DNS
- Apply changes and connect the Pi to your modem-router
- If OpenWrt's repositories are blocked, switch to a mirror via:
- System > Software > Configure opkg
- SSH into your Pi as root using the static IP address:
- Run the following commands:
Replace
netcolognewith your desired mirror
read release arch << EOF
$(. /etc/openwrt_release ; echo ${DISTRIB_RELEASE%.*} $DISTRIB_ARCH)
EOF
for feed in passwall_packages passwall_luci passwall2; do
echo "src/gz $feed https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/releases/packages-$release/$arch/$feed" >> /etc/opkg/customfeeds.conf
done
wget -O passwall.pub https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/passwall.pub && opkg-key add passwall.pub
opkg update && opkg remove dnsmasq && opkg install dnsmasq-full kmod-nft-tproxy kmod-nft-socket luci-app-passwall2
- Install the appropiate kernel module for your ethernet adapter
- For example:
opkg install kmod-usb-net-asix-ax88179
- Reboot your Pi, configure Shadowsocks and DoH via Services > Passwall2
- Head back over to Network > Interfaces and create a new interface:
- Name: wan
- Device: eth0
- Type: DHCP Client
- Verify that everything is detected and working properly. Now, it's time to make the switch:
- Change the "lan" interface device from "eth0" to "eth1", while leaving the gateway blank
- Change the "wan" interface device from "eth1" to "eth0"
If you've done everything correctly, you should be able to save and apply the changes without any warnings
- Connect the ethernet adapter to your router