Install TWRP Recovery and Root Xiaomi Redmi 5

How to Install TWRP Recovery and Root Xiaomi Redmi 5 (Plus)

Want to customize your new Redmi device? Then follow this guide to install TWRP Recovery and root Xiaomi Redmi 5 & Redmi 5 Plus using Magisk or SuperSU.


Xiaomi has seen some really good times during 2017. One major factor in its success is the “Redmi” device lineup, that focuses on bringing powerful hardware at an affordable price. Xiaomi released another Redmi series successor during December, last year. If you’ve already got the device, then here’s your chance to install TWRP Recovery on Xiaomi Redmi 5 and Redmi 5 Plus, and root it.

Install TWRP Recovery and Root Xiaomi Redmi 5

Table of Contents

How to Install TWRP and Root Xiaomi Redmi 5 (Plus)

Following the current trend, the Redmi 5 features a curved full-view display. The aesthetical features stay the same with an Aluminium body. On the inside, the phone runs a Qualcomm Snapdragon 450 processor powered by 8 cores. It comes with MIUI 9, based on Android Nougat 7.1.2.

If you consider adding more features to stock firmware or move up to a third-party firmware totally, you will need root or a custom recovery like TWRP, in that order. In this article, we will help you install TWRP recovery and root Xiaomi Redmi 5/Redmi 5 Plus.

There are several reasons why Android users desire root access on their devices and often times this arises from the need to add extra functionalities and customizations to their device. Other times it’s is just to bypass certain limitations and apply patches. Take a look at a few things you will be able to do after you root Xiaomi Redmi 5 and Redmi 5 Plus.


  • Improve your device’s overall performance using custom kernels.
  • Install custom ROMs to get the latest Android version running on your Xiaomi phone.
  • Enhance audio performance using popular mods like ViPER4Android.
  • Add extra features using Xposed Framework or Magisk.
  • Use root-enabled apps

This is just an overview of a long list of advantages.

Recently, TWRP developers have added official support for Redmi 5 and Redmi 5 Plus. We will guide you on how to easily install it using a simple Fastboot command. Further down, you will be able to use Magisk to root Xiaomi Redmi 5 and Redmi 5 Plus.


Once you have fulfilled the requirements stated above, move down below to install TWRP and root Xiaomi Redmi 5/Redmi 5 Plus.


Install TWRP Recovery on Xiaomi Redmi 5/Redmi 5 Plus

The first step in order to root Xiaomi Redmi 5, is to install TWRP recovery on it.

  1. First of all, download the TWRP recovery image for your device, from the links above.
  2. Copy the downloaded img file to C:\adb, where all the ADB and Fastboot files are present.
  3. Open the folder, hold down the SHIFT key on your keyboard and right-click on an empty space. 
  4. Select ‘Open PowerShell window here’.
  5. Boot Redmi device into Fastboot mode:
    • Power off completely.
    • Press and hold the Volume Down and Power button simultaneously.
  6. Now connect your device to your PC using the USB cable. 
  7. Finally, install TWRP on Redmi 5:
    fastboot flash recovery twrp-3.2.3-0-rosy.img
  8. Use the following command to install TWRP on Redmi 5 Plus:
    fastboot flash recovery twrp-3.2.3-0-vince.img
  9. Do not reboot your phone yet, or TWRP will be overwritten by stock recovery.

You’ve just flashed TWRP Recovery on Xiaomi Redmi 5 and Redmi 5 Plus. Now head on to root Redmi 5 using the steps outlined below.

Root Xiaomi Redmi 5 (Plus) using Magisk

  1. While the phone is still in fastboot mode, press and hold the Volume Up and Power button until the TWRP Recovery screen shows up.
  2. When prompted for the decryption password, enter the PIN/password that you previously wrote down.
  3. On TWRP Recovery menu, go to ‘Wipe’ -> ‘Format Data’.
  4. Input “Yes” in the provided field to wipe the device completely.
    Format Data in TWRP to Root Xiaomi Redmi 5
    Format Data in TWRP to Root Xiaomi Redmi 5
  5. Once wiped, reboot recovery by going to ‘Reboot’ -> ‘Recovery’.
  6. In TWRP, go to the ‘Mount’ menu.
  7. Connect your phone to the PC and press the ‘Enable MTP’ button.
  8. Then download the Magisk or SuperSU zip and transfer it to your phone’s internal storage.
  9. Disconnect the device.
  10. Return to the TWRP Recovery menu and tap on ‘Install’. 
  11. Then select the Magisk/SuperSU zip file.
  12. Finally, swipe the button on the screen to flash Magisk and root Xiaomi Redmi 5 and Redmi 5 Plus.
  13. Once the installation is complete, press the ‘Wipe Cache/Dalvik’ button.
  14. After clearing the cache, reboot your device by hitting the ‘Reboot System’ button.

I hope you find these steps easy to follow and that you enjoy the privileges of having root access on your device.

So you have just been able to root Xiaomi Redmi 5/Redmi 5 Plus and install TWRP on it. Kindly use the comment section below if you have any questions.


  1. I have successfully root my Redmi 5 MIUI 11 with Android ver 8.1 and security patch 2019-10-1, I follow the steps carefully, but at first I my phone hang at logo and into bootloop. Here is how I fix it. I enter twrp with vol up+power and then reset it from there, with the slider reset and not type yes reset. Before trying to install twrp (I assume you have unlocked your bootloader first) ,my advice is backup first, then logout of mi account and Google account and reset it first (so no password issue afterward). And then of course again enable developer option, oem unlocking, and mi unlock status should display unlocked and USB debugging and install via usb should all be enabled. After fastboot flash recovery nameofrecovery.img don’t reboot using command, instead press vol up+power and twrp will come up with still plugin in USB to pc, from there follow the above steps. Also make the twrp and\or magisk as a system apps so that you can update it inside Android itself. Also it will still be there even after wipe\reset (in hang or bootloop scenario) because it is already system app. I hope I help at least one people. Thanks you guys.

  2. I have successfully root my Redmi 5, I follow the steps carefully, but at first I my phone hang at logo and into bootloop. Here is how I fix it. I enter twrp with vol up+power and then reset it from there, with the slider reset and not type yes reset. Before trying to install twrp (I assume you have unlocked your bootloader first) ,my advice is backup first, then logout of mi account and Google account and reset it first. And then of course again enable developer option, oem unlocking, and mi unlock status should be unlocked and USB debugging and install via usb should all be enabled. After fastboot

  3. The guide is great, but i’m kind of losing my mind.
    When trying to flash Magisk, i get an error

    Above it seem to be two warnings which state “! boot image patched by unsupported programs
    ! please restore back to stock boot image”

    Where did i mess this up to get to this point where I can’t flash any OS?

  4. Hello, I realise that this might be a bit too late since this phone is a bit outdated at this point, but I recently got one just to do the thing from your guide. I followed the guide exactly, but after formatting the data, I cannot see my phone on the PC, even after mounting and enabling the file transfer through TWRP. I tried getting around this by copying the magisk zip file from my SD card to the internal storage, and running the installation, but after doing so, my phone gets put into a bootloop after rebooting.
    I used a very similar guide to yours, the ‘Flashing TWRP on Redmi 5 Plus (and Root)’ guide on the miui blog. I’m really lost as to what to do at this point, I needed to flash the stock recovery and do a full factory reset twice now. My end goal is to have magisk root with smali patcher.

    1. Hi Min. Could you let me know which MIUI and Android version are you running on your device?

    2. Hello! i have r5+ but when i flashing recovery, after rebooting i get to the system instead recovery. When i rebooting to recovery with vol- vol+ power i get to the mi recovery 3.0

    1. Hi Keith. Which version of Magisk did you use to root? I have recently updated the links for Redmi 5 (rosy) TWRP and Magisk. Please make sure that you use them instead.

  5. After all process to install twrp recovery, i have to reboot my phone in system reboot, but starting page still showing, like- ‘MI.COM’ POWDER BY ANDROID’

    actually system reboot doesn’t working.

    Please help me

    1. Hi Akib. Is it the Redmi 5 or the Redmi 5 Plus? Also, which Magisk version did you use for root?

    2. You need to flash the lazyflasher zip file and without this file you just stuck in the,just go in recovery mode and flash the lazyflasher zip file.

  6. Hello
    Redmi 5 plus

    After all steps as you described
    I can not reboot my phone normaly.
    when i reboot it, It goes to fastboot mode and stays there until it shut it self down.
    I can boot to recovery normaly.
    pls what to do.

  7. Hello, I just install Magisk in mi R5P but when i try to use any app to allow root access, don’t send me the message to allow permitions. How can i fix that?

  8. Thanks Dhananjay for your answer.

    It’s not exactly the same case. And I can’t enter the phone other than by TWRP.

    I re-installed the TWRP (3.2.3-vince) . Now I do not have a password request.
    That’s better but I can’t reboot the system.

    Same state as before: waiting on Fastboot.

    1. Okay. So, if you use TWRP to boot into Fastboot Mode (TWRP > Reboot > Bootloader), is your phone entering into fastboot?

    2. Okay. Then you can re-flash the stock firmware (fastboot image) via Mi Flash Tool to restore the phone. Make sure to select ‘Save user data’ option in the Mi Flash Tool window.

    3. After small difficulties, i got an operational fastboot stock ROM that i have installed onto my phone with success.

      Thanks a lot Dhananjay.

      Now, i have just to repeat the operation after changing password without zero in it!
      I would like to install LineageOS ROM.
      Do you know if this ROM is working fine on Redmi 5 Plus?

    4. Great! Yes, or do not set any password/PIN for time being until the whole flashing process is done. As for LineageOS, users on the XDA thread seem to be quite happy with the current builds. The latest one is LineageOS 16 based on Pie. Here’s the link to the thread.

    5. I have done all the steps but when i boot to recovery i get a black screen no trwp pls help i need to root my mi 5plus.

  9. Hi,
    I have just installed TWRP. When i fill in the password (PIN/password) which contains a zero “0” (it is the last character), TWRP did not accept this password.
    I can pass this step but the system does not reboot it stays on Fastboot each time I push the power button.
    Now, how i can go back (or continue) to recover my phone’s system?
    Thank’s for helping.

    1. Hi Pat. I have a link to a post specifically for the OnePlus devices, but I guess it will work for your phone as well. Please visit this link and follow the stated instructions. Then see if you’re successfully able to decrypt the storage in TWRP.

    2. download any custom rom for your device, get the necessary files (adb and fastboot, any recovery but i found orangefox recovery is awesome, platform tools), next copy the recovery image to the platform tools extracted folder, type cmd and enter on address bar, type “fastboot devices”, click enter, ” fastboot flash recovery *recovery image path*”, press enter, “fastboot boot *recovery image path*”, then copy custom rom into internal memory of phone, install, reboot. done.

  10. i m using redmi 5.
    at first i did like wt u said and aft entering ino twrp mode
    when i try to install super su in twrp recovery mode.its works good it gets installed and after installing root checker app frm playstore and when i check,it says ROOT ACCESS IS NOT PROPERLY INSTALLED IN THIS DEVICE..and my incoming n outgng calls are also not working

    pls tell me where i did mistake..

    1. Hi. Please uninstall SuperSU and try rooting with Magisk instead. Let me know how that goes.

  11. Just wanted to thank you for the great guide.
    Worked on redmi 5 plus Miui 10.
    P.S. Better tu use Magisk 17.3 for now, Because V18.0 is not recognised by the Magisk 6.1.0 manager on this phone.

  12. Hi,I’m using pixel experience ROM in redmi 5 but wasn’t able to flash in magisk v18 zip.Please recommend the link for magisk which is applicable

  13. I have a problem with the password for decryption…
    As others, I never put a password. But in my case, I had a scheme.
    But still, TWRP is asking for a password tat I don’t have and I’m stuck with that :/
    I tried swiping the data, reseting by factory, but TWRP still ask me for tis password even if there is none now…

    Any help ?

  14. I dont understand below line, please explain detailed. previously i no enter any pin or password

    When prompted for the decryption password, enter the PIN/password that you previously wrote down.

    1. Hi Farid, if there’s NO PIN/Password/Pattern set in the OS, then you will not be prompted to enter any password.

    1. Hi, it should work fine. Note that after flashing TWRP, it is very important to boot directly into it and NOT the OS. If the device even tried getting into the OS, the recovery will be overwritten.

  15. After doing all the steps it keeps rebooting to fastboot even if i hold the power button for 10 secs it reappears what should I do? ?

    1. Hello. That’s probably because of device encryption. After you install the TWRP recovery image, it is very important to boot directly into TWRP recovery mode directly. After you do that, simply go to Wipe -> Format Data in TWRP to completely wipe the /data partition and remove encryption.

      Once that is done, simply connect the phone to the PC, go to TWRP -> Mount and press the ‘Enable MTP’ button. Then transfer the root ZIP and flash it via TWRP itself.

    2. Hey, I’ve tried that and my phone is still stuck in fast boot mode. What can I do about that?

    3. Hi Leon. Please provide me more details about the situation. Like which ROM are you running, is it the Redmi 5 or the Plus variant, where exactly in the tutorial (After performing which step) are you stuck?

      These shall help me get a better idea of what’s going on, and thus I would be able to provide a more apt answer.

    4. Thanks for your quick answer,
      Im using Redmi 5 Plus, I used MiFlush to get my smartphone to work again, and it helped.
      After that I wanted to do it again and everyting seemed to work until the end, like before.

      Every step seems to work but the last one, whenever I installed the ZIP and try to reboot the device I end up stuck in the Fastboot screen.

  16. How do I bypass 15 days of waiting time to unlock bootloader ? Is it possible to fastboot oem unlock ?

    1. After successfully booting to twrp, can I wipe system, data and cache before flashing aosp rom ?

      Do I need to format data to remove encryption or I can wipe system if I am flashing aosp rom?

    2. If you’re running MIUI and the encryption is not disabled already, then please Format the Data. Other than that, the system, cache, dalvik etc needs to be wiped too.

  17. Hello !
    I tried to root my device using this methode.
    1- flashing TWRP using ADB while the phone is on fastboot mode then Vol+ power button to enter recovery -TWRP- this works for me. in TWRP the password didn’t pass til I perform a data wipe -it goes away actually-
    2- after re-installing the rom and Magisk + SU (wipe chache/delvik) and reboot the phone restart after a while to fastboot mode without entering the rom like there is no rom installed.
    3- re entering to TWRP goes to stock recovery.

    1. Hi Ahmed, so in your situation, I would start from scratch. And here’s what I want you to do:

      1) Install stock MIUI Fastboot image on your phone. You can get it from here
      2) Next, make sure that you only boot into the OS and remember NOT TO SET A PASSWORD/PIN/PATTERN etc.
      3) Flash TWRP and boot directly into it. Then go to ‘Wipe’ -> ‘Format Data’ and enter ‘Yes’ to format the phone completely.
      4) Once done, go to TWRP -> Mount and press the ‘Enable MTP’ button.
      5) Connect the phone to the PC using the USB cable.
      6) Download the Magisk 16.7 ZIP file and transfer it to the phone’s storge.
      7) Disconnect the phone and go to TWRP -> Install.
      8) Flash the Magisk ZIP and reboot.

      This time, your phone should boot into the OS with root using Magisk. Don’t forget to let me know of the results.

    2. Hey man.

      I got the same problem. So basically, i already tried to install twrp for rosy, and wanted to install Batik recovery instead. But i got a problem, that my sdcard is not detecting any file. It goes the same as mounting the phone (enable MTP), my pc doesn’t show any driver connect to it.

      What i did is simply unlocking the bootloader, flash the twrp through minimal adb, and ‘canceling’ the password. I get it that it just the same problem, but i don’t really know how to fix it since my phone can’t read any storage. Can you give any solution?

      Aye, Thanks

    3. Hi Edgar, after flashing TWRP, you also need to wipe the /data partition (TWRP > Wipe > Format Data) to make the internal storage accessible.

      Once formatted, go to TWRP > Mount and tap on the ‘Enable MTP’ button. Then connect your phone to the PC using the USB cable. Transfer Magisk zip and flash it using TWRP and finally boot up your phone. That’s it.

  18. Sorry, but your instruction is not complete and the result is that you can’t boot your device.

    In preparation you have to add:
    – write down your password using to open your screen, you need it when TWRP asked for the decrypt password; Xiaomi not allow passwords containing any Zero(0) in their system

    In step 9. you recommend :”Do not reboot your phone yet, or TWRP will be overwritten by stock recovery”, but in the next steps using Magisk you say: “Boot your Redmi 5 (Plus) into TWRP recovery mode”
    How you want to do this????

    What is missing:

    Until step 9 you are in Fastboot Modus, then change to recovery mode by pressing Power and Volume up without booting.

    That’s very essential. Otherwise you will not succed.

    I don’t know how you can write such an article without describing the right steps in right sequence.
    This is irresponsible.

    1. Thank you, Eberhard Stephan. It’s nice of you to correct the mistake. I have updated the article to reflect the changes. If there’s still something missing or needs omitting, please let me know. Again, thanks for your feedback.

  19. the bootloader is already unlocked when you want to install twrp please solution redmi 5 flus

    C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery twrp-3.2
    target reported max download size of 536870912 bytes
    sending ‘recovery’ (36756 KB)…
    OKAY [ 0.828s]
    writing ‘recovery’…
    FAILED (remote: Partition flashing is not allowed)
    finished. total time: 0.859s

    1. You’re welcome. Please let us know if there’s anything else you need help with.

  20. My storage after flash was empty and can’t find magisk in storage as all is empty. I use sideload to install magisk and it is work.
    I didn’t wipe and format data.
    Yes do not reboot phone after flash TWRP, boot direct to recovery!

    1. Hello, please describe the question in detail, so that i can help you better.

    2. sorry, it say like this after intering step 7 ..
      *waiting list for any devices*

    3. Yes i`m pretty sure , i`m have knowledge too in rooting android , but this is my first xiaomi and i`m rarely use adb command to root or make other task ..

      when i check adb devices , its say attached but when i entering step 7 then it like that ..

  21. How if I reboot after flashing twrp and missed the rooting steps? Do I need to re flash it again? Thanks ?

  22. C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery twrp-3.2
    target reported max download size of 536870912 bytes
    sending ‘recovery’ (36756 KB)…
    OKAY [ 0.828s]
    writing ‘recovery’…
    FAILED (remote: Partition flashing is not allowed)
    finished. total time: 0.859s

    C:\Program Files (x86)\Minimal ADB and Fastboot>

    it’s keep said that, can you pls tell me what is wrong ?
    i’ve follow every steps you said above

    1. Hi Rizky, your phone’s bootloader must be unlocked in order to flash TWRP recovery.

    1. Hi Emma, wiping the phone will ensure that it doesn’t fall into a bootloop due to dm-verity. We highly recommend doing it. However, if you have your data backed up, you can try installing the Magisk ZIP without wiping.

      Then try and boot into the OS. If it boots, then great! But in case it doesn’t, then you will have to perform a wipe and reinstall Magisk after that.

  23. Hello my friend. I tried with your steps, but the issue i’m having is that is asking for a password to decrypt the storage when TWRP screen loads. Since i haven’t setup a password, i don’t know what to put and click on Cancel. But after that, is not possible to wipe data or flash some zip because it doesn’t have access to the storage (because password wasn’t entered). I think that is about dm-verity. What do you suggest do do in this case?

    1. Hi Oscar, yes, you’re right that’s related to encryption. The password is basically the PIN/Password that you have previously set on the lock screen before flashing the TWRP recovery. Simply enter that to have access to the userdata (storage) partition.

    2. Hi,
      I got a case, quite similar with above comment, after follow all your step. Once boot to twrp recovery and asking password I click cancel (because I entered password I used before flash twrp, but keep saying that password is incorrect), eventually I can wipe-> format data, install magisk and so on.
      I can boot to OS, do basic setup (not setup password/PIN at all) and so on.
      After that, I want to install custom ROM (Pixel Experience), copy the PE zip to internal storage using USB, boot to recovery by vol up + power, then twrp ask for password “again”. I click cancel and go to Install, I can not see the PE zip file from install menu.
      What do you think to my problem here? Is there any missed step?

  24. After “fastboot flash recovery [name of recovery.img]” you have to boot directly into recovery -> “fastboot boot [name of recovery.img]”
    Otherwise TWRP will be overwritten by stock-recovery.

    1. Thanks Cua, for your feedback. The extra temporary command is not needed, you can simply use the buttons combination.

      Although, that’s a very good step that you have pointed out.

    1. No, you cannot use it on a locked bootloader. If you wish to roll back to stock MIUI, simply download the full ROM ZIP from here and flash it.

    2. No, that ZIP could be easily flashed using the stock recovery itself. Simply rename the downloaded ROM ZIP to “”. Then copy it over to the root of the phone’s storage. By “root” I mean outside all the folders.

      Then just boot into the recovery and flash it.

  25. i have a problem all is done smoothly in command follow this steps carefully flashing in command is successful then fastboot reboot but when i press volume up + power button on my redmi 5 plus it wont go to twrp only go to mi recovery..ids there any solution for this?thanks..

    1. Hi. This means the recovery didn’t flash at all. Kindly provide a screenshot of the PowerShell window when you flash the image. You can use imgur[dot]com for uploading the screenshot.

    2. C:\adb>fastboot flash recovery twrp-3.2.1-0-vince.img
      target reported max download size of 536870912 bytes
      sending ‘recovery’ (36756 KB)…
      OKAY [ 0.828s]
      writing ‘recovery’…
      OKAY [ 0.187s]
      finished. total time: 1.015s

    1. Hello, if you wish to root, you will need access to flash the TWRP recovery. After that, you wouldn’t need the PC anymore.

Leave a Reply

Your email address will not be published. Required fields are marked *