- Updating Ubuntu: Use
sudo apt update && sudo apt upgrade -y
for package updates andsudo do-release-upgrade
for OS upgrades. - Installing Shadowsocks: Install using
sudo apt install shadowsocks-libev
. - Configuring Shadowsocks: Modify
/etc/shadowsocks-libev/config.json
for server settings. - Logging: Include
"logfile": "/var/log/shadowsocks.log"
in the config, ensuring correct permissions. - Managing Shadowsocks Service: Restart with
sudo systemctl restart shadowsocks-libev
and check its status. - Launching New Instances: For additional users, create new configuration and service files, ensuring unique ports and passwords.
- Auto-Restart: Enable automatic restart on boot with
sudo systemctl enable shadowsocks-libev.service
. - Monitoring Logs: Use
sudo journalctl -u shadowsocks-libev
for detailed service logs.
This encompasses installation, configuration, and management of Shadowsocks on Ubuntu, including setting up multiple instances for different users.
-
Create a New Configuration File:
- Copy and modify the existing configuration:
sudo cp /etc/shadowsocks-libev/config.json /etc/shadowsocks-libev/config2.json
- Edit
config2.json
to changeserver_port
andpassword
.
- Copy and modify the existing configuration:
-
Duplicate and Modify the Service File:
- Copy the systemd service file:
sudo cp /lib/systemd/system/shadowsocks-libev.service /lib/systemd/system/shadowsocks-libev2.service
- Modify
shadowsocks-libev2.service
:EnvironmentFile=/etc/default/shadowsocks-libev2
- Copy the systemd service file:
-
Update Environment File:
- Copy and modify the environment file:
sudo cp /etc/default/shadowsocks-libev /etc/default/shadowsocks-libev2
- Update
/etc/default/shadowsocks-libev2
to point toconfig2.json
.
- Copy and modify the environment file:
-
Start and Enable New Service:
- Reload systemd, start and enable the new service:
sudo systemctl daemon-reload sudo systemctl start shadowsocks-libev2.service sudo systemctl enable shadowsocks-libev2.service sudo systemctl status shadowsocks-libev2
- Reload systemd, start and enable the new service: