Back to Blog

Why Your VPN Keeps Disconnecting on iOS (and How to Fix It)

July 16, 2026 · 3 min read
Why Your VPN Keeps Disconnecting on iOS (and How to Fix It) - Does your iPhone drop its VLESS connection every time you lock the screen? Here is why iOS kills background VPNs and how to stop it.

You unlock your iPhone, open Instagram, and it just spins. You look at the top corner of your screen, and the little “VPN” icon is gone. You open your VLESS app, tap the giant connect button again, and go back to Instagram. Ten minutes later, you lock your phone, put it in your pocket, and the exact same thing happens.

This is the most common frustration for iPhone users running modern proxy protocols like VLESS and Reality.

But it is not a flaw in your server. It is a flaw in how Apple designed iOS.

The Strict Parent Analogy

Imagine iOS as a very strict parent who is obsessed with the electricity bill (your battery life). When you put an app in the background, iOS tells it to go to sleep. If the app tries to stay awake and run processes, the strict parent unplugs it entirely.

When you lock your phone, iOS aggressively manages its RAM and battery. A VPN tunnel requires a constant, active heartbeat connection to the server to stay alive. If you open a heavy app—like the Camera or a 3D game—iOS looks for background apps to kill to free up memory. Because proxy clients like V2Ray Tun, Streisand, or FoXray are technically running active local network tunnels, they are often the first to get the axe.

The tunnel collapses. And you have to reconnect manually.

How to Keep the Tunnel Awake

You cannot completely disable Apple’s aggressive RAM management, but you can configure your phone to fight back. Here is the checklist:

1. Enable Background App Refresh This is the “coffee” that keeps your VPN app awake. Go to Settings > General > Background App Refresh and ensure it is turned ON for your specific VPN client (e.g., Streisand or V2box).

2. Turn Off Low Power Mode Low Power Mode (the yellow battery icon) is a death sentence for background VPNs. It instantly suspends network activity when the screen is locked. If you are having disconnect issues, do not use Low Power Mode.

3. Enable “Connect on Demand” Most good iOS proxy clients have a setting called “Connect on Demand” or “Always On.” When iOS inevitably kills the background process, this setting forces the operating system to automatically restart the VPN tunnel the millisecond you try to open a website or app. Go into your VPN app settings and ensure this is toggled on.

The Server-Side Fix

Sometimes, the disconnect isn’t happening on your phone—it’s happening on the server. If your VPS does not hear from your phone for a few minutes (because the phone is locked in your pocket), the server will silently close the connection to save resources. When you unlock your phone, the tunnel is technically “connected” on your screen, but the server has hung up the phone.

Fixing this requires SSHing into your Linux server and modifying the KeepAlive intervals in your Xray configuration JSON.

I know that writing JSON code on a command line just to watch YouTube on your phone is exactly what you were trying to avoid.

If you want a connection that just stays on without fighting your operating system, our VPN Setup Service is built for this. We configure the server-side KeepAlive settings specifically to play nice with aggressive iOS and Android battery managers, so your tunnel stays rock solid.

Have a project in mind?

Let's talk about how we can help.

Got a project idea? →