A raspberry pi proxy turns a small Linux computer and your own 4G dongle into an authenticated HTTP and SOCKS5 endpoint. This guide walks you through the reference build: Raspberry Pi OS, a Huawei E3372 HiLink dongle, a powered USB hub, and ProxyKite cloud routing so the box can work behind CGNAT.
What you need
Start with one dongle. A single complete path is easier to verify than a box full of untested sticks. Add more devices only after the first one can reach the mobile network, report online in the panel, and pass both proxy tests.
| Part | Starting choice | What to check |
|---|---|---|
| Linux box | Raspberry Pi 4 or Pi 5 with current Raspberry Pi OS | Use a stable power supply, storage, and Ethernet or Wi-Fi for outbound internet. |
| USB dongle | Huawei E3372 HiLink, or a similar compatible Huawei HiLink model | It should expose a local management page and a network interface to Linux. |
| SIM | One activated data SIM per dongle | Confirm modem use, APN requirements, allowance, and carrier terms. |
| USB hub | Externally powered hub for multiple dongles | The hub should provide peripheral power; do not make the Pi power a growing modem fleet. |
| Network | Ethernet or Wi-Fi | The Pi needs outbound internet. It does not need a static public IP or an inbound port forward. |
| Software | ProxyKite agent and cloud routing | It provides the public proxy endpoint, authentication, rotation and fleet controls. |
You provide the dongles, SIMs and mobile data plans. ProxyKite sells software and cloud routing only; it does not sell mobile IPs, SIM cards, dongles, data plans or bandwidth.
For a headless box, keep a short inventory sheet with the Pi hostname, dongle label, SIM label, hub port, local interface and proxy ID. This becomes important when two identical dongles are connected later.
Step 1: Choose the Pi and prepare power
Why this matters: a modem can draw more power than a keyboard or mouse, and a weak USB arrangement creates confusing connectivity symptoms.
Use a Pi 4 or Pi 5 for a new build when you want standard USB ports, wired networking and enough room to grow. The installer supports 64-bit ARM and ARMv7 Linux, but the number of dongles you can operate is still determined by power, USB topology, heat, storage, and the workload. It is not determined by the number printed on a USB hub.
Raspberry Pi’s computer hardware documentation recommends an externally powered hub when USB devices need more power than the board can provide. It also lists different USB budgets for different Pi models. Use the Pi’s recommended power supply, then power the dongles from a hub with its own supply.
Set up the physical layout like this:
Pi power supply ─────────────── Raspberry Pi
│ Ethernet or Wi-Fi
│ outbound internet
└── USB data cable ── powered USB hub ── HiLink dongle
Keep the hub ventilated. Do not stack warm dongles against the Pi or hide the power brick in a closed box. If you use a Pi 5, use active cooling appropriate for your case and workload.
Success looks like a Pi that boots normally with its regular network connection before you connect the modem. If that basic path is unstable, fix it first.
Step 2: Install Raspberry Pi OS and enable SSH
Why this matters: a proxy box normally runs without a monitor or keyboard, so you want a repeatable headless login before installing the agent.
Use Raspberry Pi Imager on another computer. In Imager:
- Select the exact Pi model.
- Choose Raspberry Pi OS Lite for a headless server.
- Select the microSD card or other boot media carefully.
- In OS customisation, set a hostname, time zone, username and strong password.
- Configure Ethernet or Wi-Fi details.
- Enable SSH. Public-key authentication is preferable when you already use SSH keys.
- Write the image, insert the media in the Pi, connect the network, and power it on.
Raspberry Pi’s headless setup documentation says that Imager can preconfigure networking, credentials and remote access. It also recommends Raspberry Pi OS Lite when a desktop is not required.
From your workstation, connect with the hostname or the Pi’s LAN address:
ssh YOUR_USER@YOUR_PI_HOSTNAME.local
Once logged in, update the operating system and confirm the architecture:
sudo apt update
sudo apt full-upgrade -y
uname -m
ip addr
ip route
The uname -m result should be an ARM Linux architecture supported by the installer, such as aarch64 or armv7l. ip route should show a default route through your normal Ethernet or Wi-Fi connection.
Success looks like a stable SSH session, a default route, and a clean package update. Reboot after a large kernel or firmware update, then reconnect before moving on:
sudo reboot
Step 3: Connect one HiLink dongle and check Linux
Why this matters: checking the USB device, network interface and HiLink page separately tells you whether a problem is physical, local-network related, or in the proxy software.
Insert an activated SIM into the Huawei E3372, connect it directly to the Pi for the first test, and wait for the dongle to finish starting. Then run:
lsusb
ip a
ip route
The USB list should include a Huawei device. The interface list should gain a network interface or connection associated with the dongle. Names vary by OS and device mode, so do not hard-code eth1, usb0 or another name from someone else’s screenshot.
Check the HiLink management address:
ping -c 3 192.168.8.1
curl -fsS http://192.168.8.1/ | head
Open http://192.168.8.1 in a browser on the same local network if you need to inspect the dongle’s status. Confirm that the SIM is registered and mobile data is connected. If the page loads but there is no data connection, check the SIM, APN and the carrier’s modem-use rules before changing Linux routes.
With several HiLink devices, identical default management addresses can make manual routing confusing. Add devices one at a time and let ProxyKite’s interface handling identify each dongle. Do not copy a static route from one stick to every other stick.
If Linux shows a storage device rather than a network interface, the dongle may need the normal USB mode-switching packages for your distribution. Install the packages recommended by your OS, reconnect the dongle, and run lsusb and ip a again. Keep this first pass to one stick so you can see what changed.
Success looks like all three checks working: the Pi sees the USB device, 192.168.8.1 responds, and the HiLink page reports a usable mobile data session.
Step 4: Use a powered hub before adding dongles
Why this matters: USB data can appear healthy while the modem resets or disappears when several devices draw power at the same time.
After one direct-connected dongle works, shut down the Pi cleanly and move the dongle to the powered hub. Connect the hub’s upstream data cable to the Pi, power the hub from its own supply, and boot the Pi. Check the same signals again:
lsusb
ip a
ping -c 3 192.168.8.1
Then add a second dongle and repeat. Keep a simple table as you go:
| Dongle label | SIM label | Hub port | HiLink reachable | Proxy status |
|---|---|---|---|---|
lte-01 | sim-01 | 1 | yes/no | online/offline |
lte-02 | sim-02 | 2 | yes/no | online/offline |
Do not treat the table below as a hardware guarantee. It is a sensible expansion sequence for a pilot:
| Stage | Practical plan | Stop and check |
|---|---|---|
| 1 dongle | Direct port, then powered hub | Verify the entire path before scaling. |
| 2–4 dongles | One powered hub with spare power margin | Check for USB resets, heat and stable HiLink access. |
| 5–8 dongles | Treat as a measured scaling test; consider splitting hubs | Check hub supply rating, USB layout and per-dongle status. |
| 9 or more | Consider another Pi or a deliberate multi-box layout | Split the fleet when power, heat, USB bus load or maintenance becomes difficult to isolate. |
There is no universal “maximum dongles per Pi” number. A small number of well-powered devices may be easier to operate than a larger number on a marginal hub. For more planning detail, see the related guide on powered USB hubs for 4G dongles.
Success looks like adding a dongle without changing the status of the existing one. If adding device three makes device one vanish, stop adding devices and fix power or USB layout first.
Step 5: Install the proxy agent with one command
Why this matters: the agent maintains the outbound connection to the cloud router, so you do not have to expose a listening port on the Pi or fight CGNAT with manual port forwarding.
Contact ProxyKite to obtain a licence key and use the installer from the panel. Replace the placeholder with your own key; never publish the key in a tutorial, screenshot or shell history:
curl -fsSL https://proxykite.com/install.sh | sudo bash -s -- --key YOUR-LICENCE-KEY
The installer detects supported Linux ARM architectures, downloads the matching agent, and registers the box with the key. When it completes, check the local agent:
hostyourproxy status
If the panel offers a web-terminal option and you deliberately need it, follow the panel’s command for that option. Do not enable services you do not need on a production box.
Open the ProxyKite panel and confirm that the node and the HiLink dongle appear. Give the dongle a useful label, set authentication, and choose whether to use a shared port or separate HTTP and SOCKS5 ports. The generated proxy credentials are secrets; store them in your password manager or deployment secret store.
ProxyKite’s getting-started documentation covers the panel and API workflow. The box only needs outbound connectivity, so a Pi on a private LAN or a mobile uplink can still connect to the cloud router when its network permits outbound HTTPS.

Success looks like an online node, an online proxy for the dongle, and credentials you can retrieve from the panel without putting them in a public script.
Step 6: Test HTTP and SOCKS5 through the proxy
Why this matters: a green node status proves that the box is connected, but a real request proves that authentication, the public endpoint, the dongle’s data path and the proxy protocol all work together.
Copy the host, port, username and password shown for your proxy. Use placeholders in your shell so you do not accidentally reuse someone else’s values:
export PROXY_HOST='YOUR_PROXY_HOST'
export PROXY_PORT='YOUR_PROXY_PORT'
export PROXY_USER='YOUR_PROXY_USER'
export PROXY_PASS='YOUR_PROXY_PASSWORD'
curl --fail --silent --show-error \
-x "http://${PROXY_USER}:${PROXY_PASS}@${PROXY_HOST}:${PROXY_PORT}" \
https://api.ipify.org
printf '\n'
Now test SOCKS5 with DNS resolution through the proxy:
curl --fail --silent --show-error \
-x "socks5h://${PROXY_USER}:${PROXY_PASS}@${PROXY_HOST}:${PROXY_PORT}" \
https://api.ipify.org
printf '\n'
If your password contains characters such as @, :, / or #, URL-encode it before putting it in a proxy URL, or use the panel’s ready-made connection string. ProxyKite documents both HTTP and SOCKS5 formats in its proxy formats guide.
The requests should return an IP address through the proxy. Compare the result with a direct request from the Pi only as a diagnostic; the important result is that the authenticated HTTP and SOCKS5 requests complete through the selected dongle. Do not use a public unauthenticated proxy. Keep credentials enabled or restrict client IPs with a whitelist.
Success looks like both commands return a response, the panel shows traffic for the selected proxy, and another authorised client can use the same credentials if your workflow needs it.
Verify rotation and basic controls
Once the first request works, verify the controls you will actually use. In the panel, rotate the proxy on demand and run the two curl tests again. You can also create a rotation link for automation; treat that link like a password because anyone who has it can trigger rotation for that proxy.
Set a rotation timer only after you know the workload’s session requirements. A sticky setting is useful when a workflow should keep the current address, while scheduled or on-demand rotation suits tasks that explicitly need a new mobile session. ProxyKite supports rotation on demand, by link or on a timer from 60 seconds to 7 days.
For a first verification checklist:
hostyourproxy statusreports a healthy local agent.- The panel shows the node and proxy online.
- An authenticated HTTP request completes.
- An authenticated SOCKS5 request completes with
socks5h. - The panel records traffic for the test.
- A manual rotation reports the old and new IP in the panel or API.
- A second authorised client can connect if you intend to share the proxy.
If you plan to build a larger farm, repeat this checklist for each dongle before assigning it to a customer or a production workflow. The 4G proxy farm setup guide covers inventory, hubs, cooling and expansion planning.
Troubleshooting a Raspberry Pi proxy
The Pi does not see the dongle
Run lsusb with the dongle connected directly, then through the powered hub. Try another cable and another hub port. If the device appears only as storage, install the mode-switching packages for your distribution and reconnect it. Do not add more devices until one is stable.
192.168.8.1 does not respond
Confirm that the dongle is a HiLink model and that ip a shows the related interface. Check the cable, power, SIM registration and APN. If another local network already uses the same subnet, keep the dongle’s local network isolated from the Pi’s normal LAN and use the software’s interface settings rather than copying routes by hand.
The installer rejects the architecture
Run uname -m. The current installer supports amd64, aarch64/arm64, and ARMv7 variants. Update Raspberry Pi OS and use a supported Linux image. If your box reports another architecture, contact ProxyKite before attempting to substitute a random binary.
The node is online but the proxy test fails
Check the exact host and port from the panel, confirm the username and password, and test HTTP first. If the password contains URL-reserved characters, encode it or use the exported URL from the panel. Then check that the SIM has data and that the HiLink page reports a connected session.
Adding a dongle breaks an existing one
Remove the newest device and return to the last known-good layout. Check the powered hub’s supply, cable temperature, USB resets and the Pi’s power warnings. Add devices one at a time and record the hub port so you can reproduce the working layout.
FAQ
Can a Raspberry Pi be used as a proxy server?
Yes. A Pi can run the Linux agent and manage a 4G dongle, while cloud routing provides the public endpoint. The Pi needs outbound internet access; it does not need a static public IP or an inbound port forward for this setup.
What is the best Raspberry Pi for a 4G proxy?
For a new build, a Pi 4 or Pi 5 is a practical starting point because the standard boards provide USB and wired networking. Choose the model based on your power, cooling and expansion plan, not just CPU speed. Start with one dongle and measure before you decide how many devices belong on one box.
How many 4G dongles can one Raspberry Pi handle?
There is no single safe number for every Pi, hub, power supply and workload. Use one dongle to validate the path, then add devices gradually through an externally powered hub; split the fleet across another Pi when power, heat, USB load or troubleshooting becomes difficult to isolate.
Do I need port forwarding for a Raspberry Pi mobile proxy?
Not with the ProxyKite cloud-routing design. The Pi maintains an outbound connection to the routing layer, so the customer-facing proxy endpoint does not depend on an inbound connection reaching your local router through CGNAT.
Can I use both HTTP and SOCKS5?
Yes. Each ProxyKite dongle can provide HTTP and SOCKS5 access through a shared port or separate ports, with username/password authentication or an IP whitelist. Test both protocols with the connection details shown in the panel before handing the proxy to an authorised client.
The practical sequence is simple: prove one HiLink dongle, power the fleet properly, install the agent, test both protocols, and only then scale. That gives you a Raspberry Pi proxy you can understand and operate instead of a pile of USB devices with unknown failure points.