Back to articles
AI & Cloud

Guide to Self-Configure Residential Proxy on Ubuntu VPS for Safely Managing 20 Social Media Accounts

A detailed guide on self-configuring residential proxies on an Ubuntu VPS to safely manage and operate 20 social media accounts. The guide covers installation, configuration,...

DPTCloud Engineering4 min read
Guide to Self-Configure Residential Proxy on Ubuntu VPS for Safely Managing 20 Social Media Accounts

Introduction

Managing multiple social media accounts (Facebook, Instagram, TikTok, etc.) often requires virtual IPs and distinct IP addresses to avoid detection, bans, or restrictions. An effective solution is to use residential proxies on an Ubuntu VPS. This guide will walk you through configuring residential proxies on an Ubuntu VPS to safely manage 20 social media accounts.

Requirements and Preparation

  • Ubuntu VPS: Choose a VPS with at least 4GB RAM, preferably 8GB if running multiple proxies simultaneously. Use Ubuntu 22.04 LTS or 20.04 LTS.
  • Residential Proxy: Obtain a list of residential proxies from a reputable provider (e.g., Luminati, Oxylabs, Smartproxy). Proxies must support HTTP/HTTPS and allow configuration via IP and port.
  • SSH Access: Access the VPS via SSH with root or sudo privileges.
  • Programming Language: Not required, but Python or Bash can be used for automated proxy management.

Configuring Proxy on Ubuntu VPS

We will use privoxy combined with tor or shadowsocks to create residential proxies. However, for simplicity and efficiency, we will configure residential proxies directly via iptables and systemd for traffic routing.

Step 1: Install and Configure Privoxy

sudo apt update
sudo apt install privoxy -y

Edit the configuration file:

sudo nano /etc/privoxy/config

Add the following at the end of the file:

forward-socks5t / 127.0.0.1:9050 .
forward 127.0.0.1:9050 127.0.0.1:9050

Restart Privoxy:

sudo systemctl restart privoxy

Step 2: Configure Residential Proxy

Assume you have a list of residential proxies as follows:

IP Port Username Password
192.0.2.1 8080 user1 pass1
192.0.2.2 8080 user2 pass2

Create a script to set up proxy for each account:

#!/bin/bash
# set_proxy.sh
export http_proxy="http://user1:[email protected]:8080"
export https_proxy="http://user1:[email protected]:8080"
export no_proxy="localhost,127.0.0.1"

# Check connection
curl -s https://httpbin.org/ip | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"

Step 3: Create Automated Scripts for 20 Accounts

Create a directory to store scripts:

mkdir -p /opt/proxy_accounts

Generate 20 individual scripts:

for i in {1..20}; do
  cat > /opt/proxy_accounts/account_$i.sh << EOF
#!/bin/bash
export http_proxy="http://user$i:[email protected].$i:8080"
export https_proxy="http://user$i:[email protected].$i:8080"
export no_proxy="localhost,127.0.0.1"

# Check IP
curl -s https://httpbin.org/ip | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
EOF
chmod +x /opt/proxy_accounts/account_$i.sh
done

Testing and Security

1. Check Current IP

Run the script to verify the IP:

cd /opt/proxy_accounts
./account_1.sh

If the returned IP matches the proxy IP (e.g., 192.0.2.1), the proxy is working correctly.

2. Security and Access Control

  • Allow access only from specific IPs using ufw:
sudo ufw allow from 192.0.2.1 to any port 8080
sudo ufw enable
  • Create separate users for each account to isolate them:
sudo adduser proxy_user1
sudo usermod -aG sudo proxy_user1

3. Monitoring and Automation

Use logwatch or journalctl to monitor logs:

sudo journalctl -u privoxy --no-pager -n 20

Set up cron jobs for periodic checks:

sudo crontab -e
# Add the following line:
0 * * * * /opt/proxy_accounts/account_1.sh > /tmp/account_1.log 2>&1

Troubleshooting

  • Proxy not working: Verify connectivity to the proxy IP, check firewall rules, and validate username/password.
  • IP blocked: Change the proxy IP, check for blocked proxies, or use proxies from a different provider.
  • No internet access: Check no_proxy settings and iptables configuration.

References

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478