Setup a SOCKS5 proxy server with five commands.

Here I describe how to create a SOCKS5 proxy server with authentification on Debian 9 (Stretch) using Dante in five steps.

1. Login into your VPS as root and install dante-server package:
root@server# apt-get update
root@server# apt-get install dante-server

2. Open /etc/danted.conf, delete all strings and copy-paste this (only replace xxx.xxx.xxx.xxx with your server IP address):
logoutput: stderr
internal: xxx.xxx.xxx.xxx port = 1080
external: xxx.xxx.xxx.xxx

socksmethod: username
user.privileged: root
user.unprivileged: nobody
user.libwrap: nobody

client pass {
    from: 0/0 to: 0/0
    log: error
}

socks pass {
    from: 0/0 to: 0/0
    log: error
}

3. Restart danted:
root@server# /etc/init.d/danted restart

4. Add user (replace USERNAME with a desirable username):
root@server# useradd --shell /usr/sbin/nologin USERNAME

5. Set password:
root@server# passwd USERNAME

6. (Optional) Test proxy with curl on your local machine (replace USERNAME, PASSWORD and xxx.xxx.xxx.xxx with values used above):
user@local-pc$ curl -x socks5://USERNAME:PASSWORD@xxx.xxx.xxx.xxx:1080 https://api.ipify.org/

You must get a "xxx.xxx.xxx.xxx" response (your server IP address).