Update Magisk and keep root after a system update
Two different things get called "updating": updating Magisk itself, and installing an Android system update on a rooted phone. Updating Magisk is one tap. Keeping root through a system update depends on your phone: A/B phones can keep it, other phones re-root afterwards, and rooted Samsung phones can't take OTAs at all.
Last updated 10 sourcesHow we check pages
Updating Magisk itself
- Install the new Magisk app over the old one, from the download page or the app's own update prompt.
- Open it. In the Magisk card, tap Install (or Update).
- Choose Direct install (Recommended), then Let's go.
- When it finishes, tap Reboot.
Magisk's documentation strongly recommends this for anyone who already has Magisk installed. Direct Install is only offered while Magisk is running; if the app shows Not Installed (v31.1) or Installed: N/A (v30.7), fix that first (root not detected).
Which version the app offers
The app checks GitHub according to Settings → Update channel:
| Channel | Offers |
|---|---|
| Stable (default) | The newest release on GitHub that is not marked as a pre-release |
| Beta | The newest release, pre-release or not |
| Debug | The app-debug.apk of the newest release |
| Custom | Whatever a JSON file at a URL you enter points to |
Moving from v30.7 to v31.1
v31.1 is now the stable release, so the Magisk app on v30.7 offers it as an update. It changes how Magisk works, so read this before tapping Update:
- Android 7.0 or newer. On Android 6.0, stay on v30.7.
- No root pop-ups. Apps that ask for root are no longer prompted; grant them ahead of time in the Superuser tab.
- No app hiding, no stub app. If you hid the app (it appears as "Settings" or a name you chose), unhide it first with Settings → Restore the Magisk app on v30.7. Magisk's v30.7 FAQ explains that a leftover hidden stub conflicts with the full app and makes it show Not Installed (v31.1) or Installed: N/A (v30.7); the fix is to uninstall every hidden copy you find under Settings → Apps.
- The app no longer reinstalls itself. If you uninstall the Magisk app, Magisk keeps running, but you install the APK again yourself when you need it.
Full details per release: release history.
System updates: which route is yours?
A/B phones have two copies of the system partitions, called slots. An update is written to the slot you are not using while Android keeps running, and the phone switches on the next reboot (AOSP). That gap is what lets Magisk keep root: it patches the updated slot before you boot it.
How do I install a system update on my rooted phone?
- YesNo OTAs. Patch the new firmware's
APand flash it withHOME_CSC - NoDoes
fastboot getvar slot-countshow 2 (an A/B phone)?- NoRestore stock images, update, then re-root with a computer
- YesIs it a Pixel (or a Googlebook)?
- YesInstall the update, then Install to Inactive Slot. Restore Images not needed
- NoRestore Images (don't reboot), install the update, then Install to Inactive Slot
- Yes
- No
A/B phones: keep root through an update
Keeping root through an update on an A/B phone
- 1Restore ImagesDon't reboot. Skip on Pixel
- 2Install the updateWait for both stages. Don't restart
- 3Install to Inactive SlotIn the Magisk app
- 4Restart nowFrom the system update screen
- 5Rooted on the new buildSame Magisk version
Each step below has a Done box; your progress is saved in this browser only.
-
Prepare once
2 minutesTurn off Automatic system updates in Developer options, so an update is never installed without you. Make sure you have not modified read-only partitions such as
/systemor/vendoryourself: Magisk's guide warns that even remounting them read-write breaks block verification and the update will fail. Magisk itself does not modify them by default. -
Restore images, but don't reboot
1 minuteWhen an update arrives, open the Magisk app and choose Uninstall Magisk → Restore Images. Do not reboot, or Magisk will be uninstalled. This puts the stock images back from the backup the app made, so the update's checks pass. Magisk's guide says this is unnecessary on Pixels and Googlebooks, because Google's servers send a full update when a partition has been modified.
If the app says Stock backup doesn't exist!, it has no copy of your stock image. The app keeps one only when it patched a stock partition on the phone itself (for example during an earlier Install to Inactive Slot), not when you flashed a patched file with fastboot. On a Pixel you can carry on, since Magisk's guide says Google then sends a full update. On other phones, follow the re-root route.
-
Install the update, but don't restart
10 to 30 minutesInstall the update from Settings → System → System update. Wait for both stages to finish (“Installing system update” and “Optimizing your device”). Don't tap “Restart now” yet.
-
Install Magisk to the inactive slot
2 minutesIn the Magisk app, tap Install and choose Install to inactive slot (After OTA). The app warns: "Your device will be FORCED to boot to the current inactive slot after a reboot! Only use this option after OTA is done." Confirm. The option only appears on A/B phones while Magisk is running.
-
Reboot into the new slot
2 minutesGo back to the system update screen and tap Restart now, as Magisk's current guide says. The older advice of rebooting from inside the Magisk app may not switch to the new slot. After the reboot, the Magisk app should show the same version as before, now on the new Android build.
What happens under the hood: Magisk patches the image in the updated slot, sets that slot as the one to boot next, and on the first boot marks it as successful. Magisk's guide describes this as the app tracking the switch to the updated slot, which bypasses post-update checks that would otherwise undo it.
Non-A/B phones: re-root afterwards
Magisk's current OTA guide supports system updates only on A/B phones. Its older guide (v30.7) gives the best practice for other phones, and it does not keep root:
- Make sure the stock recovery is installed. If you replaced it with a custom recovery, restore the stock one from your backup or the manufacturer's firmware.
- Restore the stock images (Uninstall Magisk → Restore Images, or flash the stock image for your current build).
- Download and install the update the normal way and reboot. You end up on a fully stock, unrooted phone.
- Patch the new build's image and flash it again with a computer, as in the patching guide.
Samsung phones
A rooted Samsung phone cannot take OTA updates. Download the new firmware, patch its AP file in the Magisk app, and flash it together with BL, CP and HOME_CSC (not CSC, which wipes data). Magisk's documentation warns never to flash an unpatched stock AP on a rooted Samsung phone, and never to restore boot, init_boot, recovery or vbmeta to stock on their own. Full steps are in the Samsung guide.
One UI 8 removed the bootloader unlock option, and users and a Magisk contributor in Magisk's issue tracker report that installing One UI 8, 8.5 or 9 firmware relocks the bootloader and removes root. A rooted Galaxy has to stay on One UI 7. See the Samsung guide.
Pixel bootloader warnings
Google's factory images page warns that the May 2025 update for the Pixel 6 and 8 series, and the May 2026 update for the Pixel 10 series, contain a bootloader update: afterwards you can't flash and boot older builds. Google advises getting the new bootloader onto both slots after the first successful boot of that build, because a failed boot can fall back to the other slot's older bootloader and leave the phone unbootable. See the Pixel guide.
Questions people ask
I already rebooted and lost root. What now?
The update is installed and the phone runs stock on the new build. Patch that build's image and flash it again, as in the patching guide. On v31.1 you can patch straight from the full OTA zip or, on a Pixel, let the app download the factory image.
I don't see "Install to inactive slot"
The app shows it only when Magisk is running and the phone is A/B. If Magisk isn't running (the app shows Not Installed or N/A), or the phone isn't A/B, use the re-root route instead.
The system update fails to install
Usually a partition is still modified: Restore Images was skipped or failed, or a read-only partition was remounted or changed. Restore Images again, or flash the stock images for your current build, then retry.
Do modules survive a system update?
Modules live in /data/adb, which an update doesn't touch, so they stay installed. A module written for the old Android version can still break on the new one. If the phone won't boot after updating, see fixing a bootloop.
Should I switch the update channel to Beta?
Only if you want pre-releases as soon as they appear. Beta offers the newest release on GitHub, pre-release or not; Stable offers the newest one not marked as a pre-release.
Sources
This page is written from the sources below. If anything here disagrees with them, the upstream source is correct.
- Magisk OTA upgrade guide (topjohnwu)
- Magisk installation guide (topjohnwu)
- Magisk FAQ (topjohnwu)
- Magisk changelog (topjohnwu)
- app_functions.sh: Ramdisk and A/B detection, restore_imgs (Magisk source)
- Magisk app strings: menu and button names (Magisk source)
- NetworkService.kt: how the update channels pick a release (Magisk source)
- A/B system updates (Android Open Source Project)
- Implement A/B updates: slot suffixes and fastboot variables (Android Open Source Project)
- Factory images for Nexus and Pixel devices: bootloader update warnings (Google)
Found a mistake or something out of date? Tell us and we will check it against the source and fix the page. Confirmed corrections are listed in the corrections log.
Report a problem with this page