3proxy is a lightweight proxy server that works both as an HTTP(S) proxy and as a SOCKS5 proxy. On your own VPS you get proxies that only you use, going out to the internet through the server's IP address.
Below are two ways.
The first is the ready-made 3proxy Manager script, which installs and configures everything by itself.
The second is a manual installation, if you want to understand the settings.
Method 1. Installing with the 3proxy Manager script
The script supports Debian 11 and newer, Ubuntu 20.04 and newer, AlmaLinux, Rocky Linux and CentOS Stream 8 and newer. Its source code is open and available on GitHub.
Step 1. Install 3proxy
Connect to the server over SSH as root, download the script and run it.
cd /root && curl -fsSL -o 3proxy.sh https://raw.githubusercontent.com/f3cloud-host/3Proxy/main/3proxy.sh && chmod +x 3proxy.sh
/root/3proxy.shThe script menu is in Russian
The script menu is in Russian, so below we translate every prompt and menu item and you can follow along without knowing the language. Answers are typed in Latin letters: y for yes and n for no.
Type 1 (Установить 3proxy, install 3proxy) and press Enter. The script asks four questions:
- Включить HTTP/S-прокси? Enable the HTTP(S) proxy? Answer
yorn. - Порт HTTP/S-прокси, its port, 3128 by default.
- Включить SOCKS5-прокси? Enable the SOCKS5 proxy? Answer
yorn. - Порт SOCKS5-прокси, its port, 1080 by default.
To keep the defaults, just press Enter four times. The script then downloads and builds 3proxy, which takes about half a minute.
HTTP(S) and SOCKS5 need different ports
The script will not let you pick the same port for both proxies, or a port that another program already uses. If the ufw or firewalld firewall is enabled on the server, the chosen ports are opened in it automatically.
Right after installation the script asks you to create the first user. Enter a login at Логин, then a password at Пароль. If you press Enter instead of a password, the script generates a strong one for you.

3proxy is installed and the first user is created
At the end, under Данные для подключения (connection details), you get one ready-to-use line per proxy. The proxies start working right away.
Step 2. Add users
It is best to create a separate user for everyone you give access to. That way you can cut off any of them without touching the rest.
Run the script again with /root/3proxy.sh. Now it shows the management menu.
| Item | What it does |
|---|---|
1 Добавить пользователя | Adds a user |
2 Удалить пользователя | Deletes a user, their access stops immediately |
3 Список пользователей | Shows all users and their passwords |
4 Удалить 3proxy | Removes 3proxy from the server completely |
5 Выход | Closes the menu |
Type 1, then the login and password of the new user.

A new user with a password generated by the script
Step 3. View the list of users
If you forgot a login or password, run /root/3proxy.sh and type 3.

The list of users with passwords
How to connect to the proxy
The connection details look like this:
http://IP:port:login:passwordfor the HTTP(S) proxy;socks5://IP:port:login:passwordfor the SOCKS5 proxy.
The line lists, in order, the proxy type, the server IP address, the port, the login and the password. If a program asks you to fill in the fields separately, copy them from this line.
You can check that the proxy works right from your home computer. The command should print your server's IP address.
# Put in the server IP address, login and password
curl -x http://SERVER_IP:3128 --proxy-user login:password https://api.ipify.orgThe proxy does not connect
Check that the service is running with systemctl status 3proxy; the Active line should say active (running). If you enabled a firewall after installing 3proxy, open the proxy ports in it, for example ufw allow 3128/tcp.
Error 407 or a wrong login and password
The proxy responds but does not accept the login or password. Compare them with the user list in item 3 of the script menu. Logins and passwords are case-sensitive.
How to change the port
The easiest way is to remove 3proxy with item 4 of the menu and install it again with new ports. You will then need to create the users again.
Method 2. Manual installation and configuration of 3proxy
This method repeats what the script does, only you run each step yourself. The commands below are for Debian and Ubuntu.
Step 1. Build 3proxy
# Install the build tools
apt update && apt install -y build-essential curl
# Download the 3proxy sources and verify the archive checksum
cd /root
curl -fsSL -o 3proxy-0.9.9.1.tar.gz https://github.com/3proxy/3proxy/releases/download/0.9.9.1/3proxy-0.9.9.1.tar.gz
echo "13711040af096f09d5202b0cb516ec08db7c08130ed21719063d2e570215fb34 3proxy-0.9.9.1.tar.gz" | sha256sum -c
# Build and install the program
tar xzf 3proxy-0.9.9.1.tar.gz
cd 3proxy-0.9.9.1
make -f Makefile.Linux
install -m 755 bin/3proxy /usr/local/bin/3proxyIf the checksum check prints 3proxy-0.9.9.1.tar.gz: OK, the archive downloaded intact. The build takes less than a minute.
AlmaLinux and CentOS use a different first command
On AlmaLinux and CentOS, install the tools with dnf install -y gcc make tar curl instead of apt. The other steps are the same.
We use version 0.9.9.1 from the LTS branch, which only receives bug fixes. You can check for updates on the 3proxy releases page.
Step 2. Create a user for the proxy
So that the proxy does not run as root, create a separate system user for it with no login.
useradd --system --no-create-home --shell /usr/sbin/nologin proxy3Step 3. Create the configuration file
Copy the whole command and run it. It fills in the proxy3 user IDs by itself.
mkdir -p /etc/3proxy
cat > /etc/3proxy/3proxy.cfg <<EOF
nserver 1.1.1.1
nserver 8.8.8.8
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
users \$/etc/3proxy/passwd
setgid $(id -g proxy3)
setuid $(id -u proxy3)
auth strong
allow *
proxy -n -a -p3128
socks -p1080
EOFWhat the lines mean:
| Line | What it does |
|---|---|
nserver | DNS servers the proxy uses to look up site addresses |
users $/etc/3proxy/passwd | Takes logins and passwords from /etc/3proxy/passwd |
setgid and setuid | After start, the proxy runs as the proxy3 user |
auth strong | Lets in only with a login and password |
proxy -n -a -p3128 | HTTP(S) proxy on port 3128 |
socks -p1080 | SOCKS5 proxy on port 1080 |
If you do not need one of the proxies, delete its line before running the command. You can change the ports to any free ones, but the two proxies need different ports.
Step 4. Add users
Each user goes on its own line in the login:CL:password format. Replace puser1 and p@ssw0rd with your own values.
cat > /etc/3proxy/passwd <<'EOF'
puser1:CL:p@ssw0rd
EOF
# Hide the files with passwords from other users of the server
chmod 600 /etc/3proxy/passwd /etc/3proxy/3proxy.cfgTo add users later, open the file with nano /etc/3proxy/passwd, add lines, save with Ctrl + O, exit with Ctrl + X and restart the proxy with systemctl restart 3proxy.
The users file must not be empty
If /etc/3proxy/passwd has no lines at all, 3proxy will not start. Keep at least one user in it.
Step 5. Run the proxy as a service
The service keeps the proxy running in the background and starts it again after the server reboots.
cat > /etc/systemd/system/3proxy.service <<'EOF'
[Unit]
Description=3proxy proxy server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/3proxy /etc/3proxy/3proxy.cfg
Restart=on-failure
RestartSec=3
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now 3proxyCheck that the service is running with systemctl status 3proxy; the Active line should say active (running). If a firewall is enabled on the server, open the proxy ports in it, for example ufw allow 3128/tcp and ufw allow 1080/tcp.
Step 6. Connect and remove the installation files
The connection details are made of the server IP address, the port, the login and the password.
http://SERVER_IP:3128:puser1:p@ssw0rd
socks5://SERVER_IP:1080:puser1:p@ssw0rdYou can check the proxy with the same curl command as in the first method. Once everything works, delete the sources, they are no longer needed.
rm -rf /root/3proxy-0.9.9.1 /root/3proxy-0.9.9.1.tar.gzOur resources
Telegram channel: https://t.me/f3cloud_news
F3 Cloud: https://f3cloud.com