How to use TWRP on Xiaomi: From Installation to System Restore

TWRP (Team Win Recovery Project) is a powerful tool for Xiaomi smartphone owners that allows access to features not available in the standard Mi Recovery. It can backup the entire system (Nandroid backup), stitch informal firmware (Custom ROM), obtain root rights through Magisk, and restore the device after serious failures. However, working with TWRP requires accuracy: one wrong action can turn your Redmi or POCO into a brick.

In this guide, we will discuss all the stages of working with TWRP on Xiaomi in 2026 - from unlocking the bootloader and installing the recovery to creating backups and firmware custom ROMs. Particular attention will be paid to the nuances for new models (for example, Xiaomi 14 or Redmi Note 13 Pro+), where the process may differ from older devices. If you are a beginner, start with the theoretical part - this will help avoid critical errors.

1. Preparation of the smartphone: unlocking the bootloader

Before installing TWRP, you need to unlock the bootloader on Xiaomi. Without this step, you can't flash custom Recovery. The process is officially supported by the company, but has limitations:

  • ⏳ Waiting 7 days (168 hours) after your Mi Account is linked to your device is a must for new models (starting with the first one). MIUI 12).
  • πŸ”— Linking the account to the device through Settings β†’ Xiaomi account β†’ Mi Cloud (unlocking is not possible without it).
  • πŸ’» Using a PC with Mi Unlock Tool drivers installed and antivirus disabled (it can block the utility).
  • πŸ“± Version. MIUI must be official (not custom) – otherwise the unlock tool will refuse access.

To start unlocking:

  1. Activate Developer Mode: Go to Settings β†’ About Phone and click on MIUI Version 7 times.
  2. Turn it on. OEM-unlocking and debugging USB Settings menu β†’ Additionally. β†’ For developers.
  3. Download Mi Unlock Tool (Windows version) and log in to it under the same Mi Account as on your phone.
  4. Connect your smartphone in Fastboot mode (click Volume Down + Power when the device is off) and follow the instructions of the program.

⚠️ Attention: On Xiaomi models 13T, Redmi Note 12 Pro and newer unlock may require confirmation via SMS If the tool gives an error "Couldn't unlock", check if you are using it. VPN Proxies – they block access to Xiaomi servers.

πŸ“Š What Xiaomi model do you use?
Redmi Note 12/13
POCO X5/F5
Xiaomi 13/14
Another model

2. Installation of TWRP: version selection and firmware

Once the bootloader is unlocked, you can start installing TWRP. It is important to choose the right version of the backpack for your model – incompatible firmware will lead to bootloop. Official builds are available on twrp.me, but new devices often require informal ports from the community (for example, for Xiaomi 14 Ultra or POCO F5 Pro).

List of proven sources for downloading TWRP:

  • πŸ”§ XDA Developers – a forum with unofficial builds for fresh models.
  • πŸ“¦ Developer Telegram channels (e.g, @twrp_xiaomi or @xiaomiui).
  • 🌐 AndroidFileHost – Storage with archives of old and new versions.

For TWRP firmware, use the command in fastboot:

fastboot flash recovery twrp-3.7.0_12-0-redminote12pro.img


fastboot boot twrp-3.7.0_12-0-redminote12pro.img

After successful firmware, boot to TWRP (via fastboot boot) immediately to avoid overwriting the recaveri with standard MIUI firmware. In the first run, the recovery will offer to allow modification of the system partition - agree (Keep System Read Only β†’ Swipe to Allow Modifications).

Battery charge > 50%|Downloaded the correct version TWRP model|Drivers installed ADB/Fastboot|Antivirus on PC is disabled|Created a backup of important data-->

3. The main functions of TWRP: backup and recovery

The main advantage of TWRP is the ability to create full backups of the system (Nandroid backup), which will save your data if you fail firmware or experiment with Custom ROM.

  1. Go to the Backup section.
  2. Select the sections for backup: Boot, System, Data, Vendor (all are recommended).
  3. Specify the location of the storage (internal memory or microSD).
  4. Swipe to start the process.

Restore from the backup is similar: Restore β†’ select file β†’ swipe for confirmation. Importantly, the backup from one Xiaomi model is not compatible with another (even within the same line, for example, the Redmi Note 12 and Redmi Note 12 Pro).

SectionWhat keepsWhen you need it.
BootCore and loaderWhen you are running a custom core or Magisk
SystemFirmware (MIUI or Custom ROM)When changing the version of Android or ROM
DataApplications, settings, user filesWhen reset or reflashed
VendorProprietary drivers and librariesWhen switching between MIUI versions

⚠️ Attention: Backup in TWRP If you save it to a microSD, anyone with physical access to the card can recover your data. Use Enable Compression to protect your data).

πŸ’‘

If TWRP doesn’t see internal memory, go to Mount and manually connect the Data partition. This may require you to enter a screen lock password (if installed).

4. Custom ROM firmware via TWRP

TWRP allows you to install informal firmware such as LineageOS, Pixel Experience or ArrowOS. However, before the firmware Custom ROM you need to:

  1. Make sure the ROM is compatible with your model (check on XDA or in developer telegram chats).
  2. Make a full backup of the current system.
  3. Format the Data partition (if you need firmware) because some ROMs (such as those based on Android 14) are not compatible with older data structures.

Typical firmware process:

1. Reboot to TWRP.


2.Tap Wipe β†’ Advanced Wipe and mark Dalvik, Cache, System, Data, Vendor.




3. Go back to the main menu and select Install.




4. Specify the path to the ROM file (usually in.zip format).




5. additionally, go through Gapps (if they are not part of ROM) and Magisk (for root).




6. Swipe for confirmation and wait for completion.




7. Reboot to the system.

The first boot after the firmware Custom ROM can take 10-15 minutes. If the device hung on the logo for more than 20 minutes, then the firmware is not suitable or steps were missed (for example, not stitched Vendor or Firmware).

What to do if the Custom ROM is not loading?
If the device is stuck with the logo or crashed into fastboot after firmware, try: 1. Repeat the firmware with a full wip (Format Data β†’ enter yes). 2. Swipe the official firmware through the Mi Flash Tool, then re-install ROM. 3. Check the compatibility of the Firmware version (for example, MIUI 14 may require firmware from MIUI 13).

5. Getting root rights through Magisk

TWRP is often used to install Magisk, a root-based tool that allows you to pass SafetyNet (which is required for banking applications and Google Pay), and Magisk's most recent stable version for 2026 is v26.4.

Installation instructions:

  1. Download Magisk.zip (not.apk!).
  2. Reboot to TWRP.
  3. Press Install and select the downloaded file.
  4. Swipe for firmware, then restart.
  5. After downloading, install Magisk Manager (downloaded as APK from GitHub).

To hide root from apps (for example, for Sberbank or Tinkoff):

  • Open Magisk Manager.
  • Go to Settings. β†’ Hide Magisk.
  • Rename the Magisk Manager package (e.g., com.topjohnwu.magisk.random).
  • Enable Enforce DenyList and add banking apps to the list.

⚠️ Attention: On devices with MIUI 14 and later Magisk may conflict with the function Mi Anti-Rollback. If after firmware smartphone does not boot, run the official firmware through the Mi Flash Tool with the option of clean all and lock, then repeat the unlock process.

πŸ’‘

Magisk allows you to get root rights without changing the system partition, which keeps SafetyNet and banking applications working, but new models Xiaomi (2023-2026) may require additional kernel customization to bypass checks.

6. Common mistakes and their solutions

TWRP on Xiaomi is often accompanied by errors, especially on new devices.

Mistake.Reason.Decision
Failed to mount /data (Invalid argument)Encrypted Data (if PIN/password is used)Enter a password in TWRP or format a section (Format Data β†’ Yes)
E: Unable to locate packageDamaged. ZIP-firmwareDownload the file and check the checksum (MD5)
This package is for "violet" devices; this is a ""The firmware is not compatible with the device modelCheck the coded name of your device (fastboot getvar product)
Hanging on the MI logo after firmwareNot to be sold by Vendor or FirmwareReturn to TWRP and re-furbish the missing components

If the TWRP doesn't start after the firmware is up and the device loads immediately into MIUI, then the standard firmware has overwritten the Recovery.

  • πŸ”„ After the first loading in TWRP file disable_anti_rollback.zip (available XDA).
  • πŸ”§ Install Magisk immediately after firmware TWRP β€” This will block automatic recovery of standard recavery.

7. Recovery of the device after failures

If you've had a TWRP experience, and you've stopped booting or turned into a brick, don't panic. In 90 percent of cases, you can restore the device.

  1. Try booting up to TWRP (click Volume Up + Power). If the recaveri works, restore the backup or run the official firmware through Install β†’ Select Image (select a file with the.tgz extension for MIUI).
  2. Use the Mi Flash Tool if TWRP is not available: 1. Download the official firmware for your model from Xiaomi. 2. Unpack the archive and place the folder at the root of the C:\. 3. Download the device to fastboot (Loudness down + Power). 4. In the Mi Flash Tool, select the firmware folder and click Refresh, then Flash. 5. For a full reset, select the clean all option.
  3. If the device is not determined by the PC, check the drivers (Qualcomm) HS-USB QDLoader 9008 or try another one. USB-port (preferably) USB 2.0).

⚠️ Note: On models with a MediaTek processor (e.g. Redmi Note 12) 4G or POCO M5) Recovery may be required SP Flash Tool instead of Mi Flash Tool. In this case, be sure to download the Scatter file for your model, otherwise you risk damaging the file. NAND-memory.

FAQ: Frequent questions about TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, all Xiaomi devices (except some older models before 2016) require an unlocked bootloader to run TWRP firmware, which is technically only possible through exploits (like DirtyCOW), but they don’t work on all firmware and are fraught with data loss.
Why does TWRP not see internal memory?
This is due to the encryption of the data partition in MIUI. Solutions: Enter the screen lock password in TWRP (If you request it, format your data via Wipe. β†’ Format Data (all data will be deleted!) Use microSD or OTG-Backup storage drive. New devices (e.g. Xiaomi 13) may need to be disabled FBE (File-Based Encryption via Magisk patch.
How to upgrade TWRP to a new version?
The TWRP update is done in the same way as the original installation: Download the new version of the recovery (.img file). Reboot to the current TWRP. Go to Install β†’ Install Image and select the downloaded file. Specify the Recovery partition and swipe for firmware. Do not update TWRP through fastboot flash recovery if you already have the old version installed - this can lead to conflicts.
Can I flash TWRP on Xiaomi with a MediaTek processor?
Yes, but the process has nuances: For firmware use SP Flash Tool instead of fastboot. TWRP Only from verified sources (only XDA There is a separate section for MTK-Before the firmware, turn off the device OEM Lock in the developer settings (otherwise you will get an error) SLA Popular models from MediaTek: Redmi Note 11/12 4G, POCO M4 Pro, Xiaomi Civi 2.
How to remove TWRP and return standard recap?
To return the original MIUI recovery: Download the official firmware for your model (.tgz file). Unpack the archive and find the recovery.img file. Sweat it through fastboot: fastboot flash recovery recovery.img fastboot reboot Alternatively, swipe the full official firmware through the Mi Flash Tool with all clean and lock option - this will return the standard backcover and block the bootloader.