Keeping a VPN alive on Samsung and Xiaomi phones
Samsung Device care and Xiaomi's autostart and battery saver can stop a VPN in the background. The settings to change on each, plus Always-on VPN.
Samsung and Xiaomi phones stop background VPNs more often than stock Android does, because each layers its own power manager on top of Android's. On Samsung the fix is to add the VPN app to Never sleeping apps in Device care and set its battery use to Unrestricted; on Xiaomi it is to turn on Autostart for the app and set its battery saver mode to No restrictions. On both, turn on Always-on VPN in the system VPN settings as well, so the phone restarts the tunnel if anything still stops it.
Why these two phones in particular
Android already limits what apps can do in the background, and the battery optimisation post covers the stock settings. Samsung's One UI and Xiaomi's MIUI and HyperOS add a second layer with its own lists and its own defaults. A VPN app that has done everything Android asks, running a foreground service and showing the required notification, can still be stopped by that second layer, because it does not consult Android's rules.
The result is a VPN that is connected while you use the phone and gone when you pick it up an hour later, with no error and nothing in the app's own log. The system killed the process, and unless Always-on VPN is set, nothing restarts it.
Menu names below are for recent versions of One UI and MIUI or HyperOS. Both manufacturers rename and move these settings between releases, so if a path does not match, search Settings for the setting's name.
Samsung (One UI)
- Open
Settings > Battery and device care > Battery > Background usage limits. - Tap Never sleeping apps and add the VPN app. This is the list the power manager consults before putting an app to sleep.
- On the same screen, consider turning off Put unused apps to sleep. It is optional; the Never sleeping list already exempts the VPN, but turning it off avoids the app being re-evaluated after a period without use.
- Open
Settings > Apps, find the VPN app, tap Battery, and choose Unrestricted. This is the underlying Android setting, and Samsung honours it as well as its own list. - Open
Settings > Connections > More connection settings > VPN, tap the gear next to the VPN app, and turn on Always-on VPN.
Two Samsung-specific notes. Adaptive battery, under the same Battery menu, learns which apps you use and restricts the rest; leaving it on is fine once the VPN is on the Never sleeping list. And if the phone has a Power saving mode enabled, some versions apply stricter background limits while it is on; if the VPN only drops when power saving is active, that is the cause.
Xiaomi (MIUI and HyperOS)
- Open
Settings > Apps > Manage apps, find the VPN app and open it. - Turn on Autostart. Without this, MIUI does not allow the app to start itself, which blocks both the app's own reconnect logic and, on some versions, Always-on VPN's attempt to restart it.
- On the same screen tap Battery saver and choose No restrictions.
- Open the Recents view, find the VPN app's card and lock it (pull the card down, or tap the lock icon, depending on version). Locked apps are not cleared when you tap the clear-all button or when the system trims memory.
- Open
Settings > Connection & sharing > VPN, tap the gear next to the VPN app, and turn on Always-on VPN.
If the phone has an option called MIUI optimisation under Developer options, leave it on. Turning it off changes how permissions and background behaviour work in ways that are hard to predict, and it is not needed for a VPN.
Always-on is the part that makes the rest optional
Every setting above reduces how often the manufacturer's power manager kills the VPN. None of them makes it impossible. Always-on VPN is different in kind: it is Android's own instruction to start the VPN at boot and restart it whenever it stops, and it runs from the system rather than from the app. With it set, a VPN that is stopped comes back on its own within moments, which turns a lost tunnel into a brief gap.
If you also want that gap closed, turn on Block connections without VPN on the same screen, which holds all traffic until the tunnel is back. Always-on VPN covers both toggles and their one side effect, and why no in-app setting can do the same job.
Telling the layers apart
If the VPN still drops after all this, it helps to know which layer is responsible:
- Drops only with the screen off, comes back when Always-on restarts it: the manufacturer power manager. Recheck the lists above; a system update sometimes resets them.
- Drops while you are using the phone: not a background issue. Look at the network instead, starting with VPN keeps disconnecting on Android.
- Gone after a restart and never comes back: Always-on VPN is not set, or on Xiaomi, Autostart is off.
- Drops when switching between Wi-Fi and mobile data: a normal reconnect; the app should recover in seconds, and if the block is on you will see a brief pause.
The screen-off case has its own post, VPN disconnects when the screen turns off, which is largely this article applied to that symptom.
Culvert VPN runs as a normal foreground service and reads Android's real always-on and block state on its Settings screen with a link to the system page, so on any phone the fix is the same three settings, and the app is on Google Play.
Questions people also ask
Why does my VPN work on a Pixel but not on my Xiaomi?
Because Xiaomi's MIUI and HyperOS add their own background limits on top of Android's, and a new app is not allowed to start itself until you turn on Autostart for it. Stock Android has no equivalent switch.
Is locking the app in Recents enough on Xiaomi?
It helps, and it is quick, but it is not the whole fix. Autostart and the battery saver setting also need changing, and Always-on VPN is what brings the tunnel back if the app is still stopped.
Will these changes affect the rest of the phone's battery?
Only for the one app you exempt. An idle VPN tunnel sleeps between keepalives, so allowing it to stay alive costs little compared with a tunnel that is killed and restarted all day.