Smartproxy Setup Guide: How to Use Residential Proxies on Linux for Beginners
A beginner-friendly tutorial for setting up Smartproxy residential proxies on Linux. Learn to configure HTTP and SOCKS5 proxies for curl, wget, and Python, with authentication and rotation tips.
Overview
Smartproxy is a beginner-friendly proxy service offering residential and datacenter proxies with HTTP and SOCKS5 support. This guide shows you how to set up Smartproxy on Linux for command-line tools and Python scripts, so you can route traffic through rotating residential IPs for privacy or web scraping. We'll cover authentication, proxy configuration, and basic rotation.
Prerequisites
- A Smartproxy account (residential or datacenter plan).
- Linux system with terminal access.
- Basic familiarity with command-line tools like
curland Python. - Optional: Chrome or Firefox for the Smartproxy browser extension.
Understanding Smartproxy Endpoints
Smartproxy provides different endpoints for residential and datacenter proxies. After logging into your dashboard, you'll find:
- Residential proxies:
gate.smartproxy.com(or similar) with ports for HTTP/SOCKS5. - Datacenter proxies:
dc.smartproxy.com(or similar) with HTTP/SOCKS5 ports. Authentication is via username and password. You can also whitelist your IP address.
Steps
1. Get Your Proxy Credentials
- Log in to your Smartproxy dashboard.
- Navigate to the Residential or Datacenter section.
- Note your proxy endpoint (e.g.,
gate.smartproxy.com) and port (e.g.,7000for HTTP,7001for SOCKS5). - Create or retrieve your proxy username and password.
2. Test the Proxy with cURL
Use curl to verify your credentials and connection. Replace placeholders with your details.
curl -x http://username:[email protected]:7000 https://httpbin.org/ip
If successful, you'll see your proxy IP in the response. For SOCKS5, use socks5:// instead.
3. Configure System-Wide Proxy (Optional)
For applications that respect environment variables, set them in your shell:
export http_proxy='http://username:[email protected]:7000'
export https_proxy='http://username:[email protected]:7000'
To make permanent, add these lines to ~/.bashrc or ~/.profile.
4. Use Smartproxy with Python Requests
Install requests if needed:
pip install requests
Then use the proxy in your script:
import requests
proxies = {
'http': 'http://username:[email protected]:7000',
'https': 'http://username:[email protected]:7000'
}
response = requests.get('https://httpbin.org/ip', proxies=proxies)
print(response.json())
For SOCKS5, install requests[socks] and use socks5://username:[email protected]:7001.
5. Rotate IP Addresses
Smartproxy residential proxies rotate IPs automatically per request or via sticky sessions. To get a new IP for each request, simply use the same endpoint. For a sticky session (same IP for multiple requests), append a session ID to your username:
curl -x http://username-session-123:[email protected]:7000 https://httpbin.org/ip
Replace 123 with any number. The session lasts up to 10 minutes (check Smartproxy docs for exact duration).
6. Use the Smartproxy Browser Extension
Smartproxy offers a browser extension for Chrome and Firefox (works on Linux). Install it from your browser's add-on store, then log in with your Smartproxy credentials. You can switch between proxy locations without changing system settings.
Troubleshooting
- 407 Proxy Authentication Required: Double-check your username and password. Ensure they are URL-encoded if they contain special characters.
- Connection timeout: Verify the endpoint and port. Try a different port (HTTP vs SOCKS5). Check your firewall.
- SSL errors: For HTTPS targets, use the HTTP proxy protocol (
http://) even when the target is HTTPS. The proxy handles CONNECT. - Slow speeds: Datacenter proxies are often faster than residential. Try a different location or switch proxy type.
Summary
You've learned how to set up Smartproxy residential proxies on Linux for cURL, Python, and system-wide use. Remember to use the correct endpoint and port, authenticate properly, and leverage session IDs for sticky sessions. The browser extension provides a quick way to switch IPs for manual browsing. With these steps, you can route traffic through Smartproxy for privacy or scraping tasks.