Set Up a Local HTTP Proxy on Android Using Termux (No Root)

12 min read Learn step‑by‑step how to install Termux, run a lightweight HTTP proxy (tinyproxy) on your Android device, and configure the system to route traffic through it – all without rooting. October 03, 2026 11:00 How to Set Up a Local HTTP Proxy on Android Using Termux (No Root)

Before you start

Make sure your device is charged above 50 % and connected to a stable Wi‑Fi network. You will need an active internet connection to download Termux and the proxy packages. The steps below work on Android 8.0 (Oreo) and newer; older versions may have slightly different Settings menus.

  • Backup important data – the tutorial only touches user‑space files, but a mis‑typed command could affect installed apps.
  • Enable Developer options (Settings > About phone > Tap “Build number” seven times).
  • Turn on USB debugging (Settings > System > Developer options > USB debugging).

1. Install Termux and grant storage permission

  1. Open the Google Play Store (or F‑Droid for a fully open‑source build) and search for Termux. Install the app.
  2. Launch Termux. The first run will automatically set up a minimal Linux environment.
  3. Grant Termux access to your shared storage so it can read/write files you might want to proxy. Run:
    termux-setup-storage
    Accept the permission prompt that appears.

2. Update the package repository and install a lightweight proxy

  1. Refresh the package lists and upgrade existing packages:
    pkg update && pkg upgrade -y
  2. Install tinyproxy, a small HTTP/HTTPS proxy that runs comfortably on a phone:
    pkg install tinyproxy -y
  3. Verify the installation:
    tinyproxy -v
    You should see a version string like tinyproxy/1.10.0.

3. Configure tinyproxy

tinyproxy reads a configuration file located at $PREFIX/etc/tinyproxy/tinyproxy.conf. The default file works, but we’ll tweak a few settings for a smoother mobile experience.

  1. Open the config with the built‑in editor nano (install it if missing with pkg install nano):
    nano $PREFIX/etc/tinyproxy/tinyproxy.conf
  2. Locate the line that begins with Port and change the port to something unlikely to clash with other apps, e.g., 8888:
    Port 8888
  3. Uncomment (remove the leading ‘#’) the Allow directive and limit access to the local device only:
    Allow 127.0.0.1
    This prevents other devices on the Wi‑Fi network from using your proxy unintentionally.
  4. Optionally, enable basic logging for debugging. Find the LogLevel line and set it to Info:
    LogLevel Info
  5. Save and exit nano (Ctrl + O, Enter, Ctrl + X).

4. Start tinyproxy as a background service

Termux can keep processes alive after you close the app using the termux-wake-lock and nohup utilities.

  1. Acquire a wake lock so the CPU stays on while the proxy runs:
    termux-wake-lock
  2. Start tinyproxy in the background and redirect output to a log file for later inspection:
    nohup tinyproxy -c $PREFIX/etc/tinyproxy/tinyproxy.conf > $HOME/tinyproxy.log 2>&1 &
  3. Confirm that the process is running:
    ps | grep tinyproxy
    You should see an entry with the command you just launched.

5. Verify the proxy works locally

Before routing all traffic, test the proxy with a simple curl request.

  1. Install curl if it isn’t already present:
    pkg install curl -y
  2. Make a request through the proxy to a known site:
    curl -x 127.0.0.1:8888 https://httpbin.org/ip
    The JSON response should contain an origin field showing your public IP – the request has passed through the proxy.

6. Set Android to use the proxy system‑wide

Android offers two ways to point apps to a proxy: via the UI (per‑Wi‑Fi network) or via ADB for a device‑wide setting. The UI method is simpler but only applies when you’re connected to the specific Wi‑Fi network.

6.1 Using the UI (Wi‑Fi‑specific)

  1. Open Settings → Network & internet → Wi‑Fi.
  2. Long‑press your current network name and choose Modify network (or tap the gear icon on newer Android versions).
  3. Expand Advanced options and set Proxy to Manual.
  4. Enter 127.0.0.1 as the Proxy hostname and 8888 as the Proxy port. Leave the Bypass proxy for field empty unless you need exceptions.
  5. Save the changes. Your browser and most apps that respect Android’s proxy settings will now route through tinyproxy.

6.2 Using ADB for a device‑wide proxy (works on all networks)

This method writes the proxy configuration to the global settings database, affecting all Wi‑Fi connections.

  1. On your PC, install the Android SDK Platform‑Tools if you haven’t already. Connect the phone via USB and authorize the computer.
  2. Run the following command to set the proxy globally:
    adb shell settings put global http_proxy 127.0.0.1:8888
  3. To verify, run:
    adb shell settings get global http_proxy
    It should echo 127.0.0.1:8888.
  4. To clear the proxy later, execute:
    adb shell settings delete global http_proxy

7. Test the proxy with a regular app

Open Chrome (or any browser) and navigate to https://www.whatismyip.com/. The site should display the same IP address you saw in the curl test, confirming that traffic is passing through tinyproxy.

If you notice that the page fails to load, double‑check the following:

  • tinyproxy is still running (ps | grep tinyproxy).
  • The proxy port (8888) isn’t blocked by Android’s battery‑optimization settings. You may need to disable battery optimisation for Termux (Settings > Apps > Termux > Battery > Allow background activity).
  • The Wi‑Fi network does not have its own proxy configuration that overrides your setting.

8. Optional: Use the proxy for ad‑blocking or content filtering

tinyproxy can be extended with a simple filter file that blocks requests matching patterns. This is handy if you want a lightweight ad‑blocker without installing a full VPN‑based solution.

  1. Create a filter file:
    cat > $HOME/tinyproxy.filter <<'EOF'
    # Block common ad domains
    .*\.doubleclick\.net
    .*\.googlesyndication\.com
    .*\.adservice\.google\.com
    EOF
  2. Edit the config again and add the line:
    Filter $HOME/tinyproxy.filter
    Save and restart tinyproxy (kill the old process and start it again with the nohup command from step 4).

After restarting, requests to the listed domains will be denied with a 403 Forbidden response, effectively blocking many ads.

Troubleshooting

Proxy won’t start – "Address already in use"

  • Another app may already be listening on port 8888. Use netstat -tulpn | grep 8888 to see the conflict.
  • Change the Port line in tinyproxy.conf to an unused port (e.g., 8080) and update the system proxy setting accordingly.

Apps ignore the proxy

  • Some apps (e.g., Facebook, Instagram) use their own network stacks and bypass Android’s proxy settings. For those, consider a VPN‑based approach instead of a plain HTTP proxy.
  • Make sure you haven’t enabled a proxy‑exclusion list in the Wi‑Fi settings.

Proxy stops after the screen turns off

  • Android may kill background processes to save battery. Open Settings → Apps → Termux → Battery and set Allow background activity to Allowed.
  • Alternatively, keep Termux in the foreground or use a Termux plugin like termux-wake-lock (already enabled in step 4).

Safety and privacy notes

  • Running a proxy on 127.0.0.1 means only apps on the same device can reach it. Do NOT change the Allow line to 0.0.0.0/0 unless you understand the network exposure risks.
  • The proxy does not encrypt traffic. HTTPS connections remain encrypted end‑to‑end; only HTTP traffic is visible to tinyproxy.
  • If you enable custom filtering, be aware that over‑blocking may break legitimate sites. Keep a backup of the original config file (cp tinyproxy.conf tinyproxy.conf.backup) before making changes.

Wrap‑up

By following these steps you now have a fully functional, local HTTP proxy running entirely in user space via Termux. You can route web traffic through it, add simple domain filters, and even use the setup as a stepping stone toward more advanced proxy or VPN configurations—all without ever rooting your device.

When you no longer need the proxy, simply stop the process (pkill tinyproxy), release the wake lock (termux-wake-unlock), and clear the global proxy setting with adb shell settings delete global http_proxy. Your Android device will return to its normal networking behavior.

User Comments (0)

Add Comment
We'll never share your email with anyone else.