Start A Shadowsocks-Rust VPS With Podman or Docker


In this guide, I’ll help you buy your own VPS and show how to set up a Shadowsocks-Rust VPS inside a Docker or Podman container.


Buying The VPS


  • I will be buying Vultr they offer a decent server for a cheap price.
  • If you plan to use something other than Vultr make sure it’s a reliable, reputable service.

Let’s start by going to Vultr’s website and making a new account.

  • Vultr offers $250 USD in credit for free to new customers here.

On your homepage at the top right there will be a “Deploy” button, press that, and press deploy new server.

I’ll be deploying the cheapest option for $5 USD this should be enough for most people, you’ll get 1TB of bandwidth monthly.

Select “Cloud Compute – Shared CPU”.

Select the location, for fast speeds and low ping the closest location to you will be the best.

Choosing the OS is up to you, just pick a standard Linux distribution, I’ll use “Rocky Linux 9”.

For the plan, select “Regular Cloud Compute” and choose the cheapest option. If you get an offer like I did, say “No Thanks”.

On “Additional Features” disable “Auto Backups” then enable “IPv6” and “Limited User Login” which will save you the hassle of creating a user account.

For “Server Settings” you can ignore this, the distribution you chose should have a built-in firewall already.

Give the server a hostname and label, this can be whatever you want.

The last thing to do is hit deploy at the bottom.

The server will start deploying, you can see that after you click on the “Compute” tab to the left.

Logging into your VPS, updating it & installing Podman or docker


SSH Into The VPS

With MacOS or Linux, you can SSH into your VPS by using the terminal.

On Windows, the recommended SSH tool is PuTTY, but PowerShell also has SSH.

Before you SSH into the VPS, you’ll need the IP and the user password.

Head over to the “Compute” tab and click on your VPS name.

You’ll see the VPS IP address for IPv4 and IPv6 also your user account information.

In terminal, run ssh YOURSERVERIP@linuxuser and enter your password.

Updating The VPS & Installing Docker Or Podman

After you logged into the VPS first update it, run sudo dnf update after the update finished run sudo systemctl reboot, SSH into the VPS after the reboot and run sudo dnf install podman, but if you want to use Docker follow Dockers installation instructions here.

Creating The Shadowsocks-Rust Server


I’ll be using Podman, but if you use Docker it’ll be similar since Podman is a 1:1 to Docker, just replace “podman” with “docker” in commands.

In terminal run podman pull ghcr.io/shadowsocks/ssserver-rust:latest in terminal, this is an official Shadowsocks-Rust server image.

After the pull, we’ll create a configuration file, run nano config.json and paste in what I’ve left below.

{
"server": "0.0.0.0", # This has to be 0.0.0.0 for Podman or Docker.
"server_port": 8388, # Choose any port, 8388 is the default Shadowsocks port.
"password": "", # Use a strong password.
"method": "chacha20-ietf-poly1305"
}

You can now run podman run –name ssserver-rust –restart always -p 8388:8388/tcp -p 8388:8388/udp -v ~/config.json:/etc/shadowsocks-rust/config.json:Z -dit ghcr.io/shadowsocks/ssserver-rust:latest after it runs your Shadowsocks server is on, but you can’t connect to it yet.

The final step is open the port you chose, to do this run sudo firewall-cmd –zone=public –permanent –add-port={8388/tcp,8388/udp} && sudo firewall-cmd –reload.

Using Podman create an autostart systemd service

  • If you are using Docker, this doesn’t apply to you, Docker will start Shadowsocks automatically.

In terminal, run podman generate systemd –new –name ssserver-rust, copy the output, and run cd /etc/systemd/system then run sudo nano ssserver-rust.service and paste it in.

Now enable the service by running sudo systemctl enable ssserver-rust.service.

Finishing up


Restart the server and make sure everything works by connecting to it.

I also recommend securing your server and creating a firewall on Vultr’s dashboard, set only the port you used for Shadowsocks and the SSH port which is 22.

To use the Shadowsocks server safely, you need to proxy your DNS server when connecting from your browser, this is what it looks like in Firefox.

Make sure it is proxying your DNS by running a DNS leak test here. If the results are anything but Vultr’s DNS, you have a DNS leak.

Also, if you need something simpler, my guide for using IVPN’s V2Ray servers without their app or something more serious, my V2Ray guide.

Leave a Comment

Your email address will not be published. Required fields are marked *