Skip to content

Instantly share code, notes, and snippets.

@hoanganhcoder
Created June 11, 2025 09:44
Show Gist options
  • Select an option

  • Save hoanganhcoder/d3f366b35802b4d2ffd2f94f32e676f9 to your computer and use it in GitHub Desktop.

Select an option

Save hoanganhcoder/d3f366b35802b4d2ffd2f94f32e676f9 to your computer and use it in GitHub Desktop.
How to create http/socks5 proxy on Ubuntu 22.04
  1. Grant execution permissions:
chmod +x setup_3proxy.sh
  1. Run as root:
sudo ./setup_3proxy.sh

wait process success !

#!/bin/bash
# Install dependencies
apt update
apt install build-essential wget git -y
# Install 3proxy
git clone https://github.com/3proxy/3proxy.git
cd 3proxy
make -f Makefile.Linux
mkdir -p /usr/local/3proxy/{bin,logs}
cp src/3proxy /usr/local/3proxy/bin/
cd ..
# Create configuration
cat > /usr/local/3proxy/3proxy.cfg <<EOF
daemon
maxconn 500
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
auth strong
users proxyuser1:CL:password1 proxyuser2:CL:password2 proxyuser3:CL:password3
allow proxyuser1,proxyuser2,proxyuser3
proxy -n -a -p1080
socks -p1081
log /usr/local/3proxy/logs/3proxy.log D
EOF
# Create systemd service
cat > /etc/systemd/system/3proxy.service <<EOF
[Unit]
Description=3Proxy Proxy Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/3proxy/bin/3proxy /usr/local/3proxy/3proxy.cfg
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# Start service
systemctl daemon-reload
systemctl enable --now 3proxy
# Firewall setup
ufw allow 1080/tcp
ufw allow 1081/tcp
ufw reload
echo "3proxy installed and running!"
echo "HTTP proxy port: 1080"
echo "SOCKS5 proxy port: 1081"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment