How to install firmware on Xiaomi: from the official MIUI to custom assemblies

Installing firmware on Xiaomi smartphones is a process that can both bring a device back to life and turn it into a β€œbrick” if you approach it without preparation. Unlike the usual update through Settings β†’ About Phone β†’ System Update, manual firmware requires understanding the nuances from unlocking the bootloader to choosing the right version of MIUI for your model. This article covers all the steps from preparation to solving typical errors, with a focus on current methods for devices in 2020-2026.

It is important to understand that the procedure is different for official and custom firmware. The former (for example, stable MIUI or beta) are supported by the manufacturer and retain the warranty if the bootloader is not affected. The latter (like LineageOS or Pixel Experience) open up new possibilities, but require unlocking and carry risks. We will analyze both scenarios, and also explain how to avoid common errors, such as Error: Anti-rollback or hanging on the Mi logo.

If you’ve never flashed a smartphone before, start with the official methods β€” they’re as safe as possible and often solve problems with lags or bugs. For experienced users, here are instructions for working with fastboot and TWRP, including nuances for devices on the Qualcomm and Mediatek platform.

1. Device Preparation: What to Do Before Firmware

The first step is to check the current state of your smartphone and create a backup. Even if you install the official firmware, a Wipe Data reset may be required, and without a backup, you will lose contacts, photos and app settings.

Use Xiaomi’s built-in backup (Settings β†’ Phone β†’ Backup) or third-party tools like Swift Backup (requires root). Note: Backup via Mi Cloud doesn’t save some system settings, so it’s best to combine the cloud with a local backup on your PC.

  • πŸ“± Check the device model: go to Settings β†’ About Phone β†’ Model. For example, the Redmi Note 11 Pro+ 5G is codenamed veux, and POCO F4 is munch. This is critical for choosing the right firmware.
  • πŸ”‹ Charge the battery to a minimum of 60 percent. Interrupting the process due to discharge may make it impossible to recover the device without service equipment.
  • πŸ”Œ Prepare the cable and PC: Use the original USB- cable (preferably from the kit) and port USB 2.0 on your computer – this reduces the risk of data transmission errors.
  • πŸ›‘οΈ Disable antivirus: Programs like Kaspersky or Avast can block firmware files or tools like the Mi Flash Tool.

⚠️ Warning: Devices with MIUI 14+ and newer versions may be enabled with Factory Reset Protection (FRP). If you reset via fastboot without disabling FRP in the settings, the phone will require you to enter your last Mi Account after the reboot.

πŸ“Š What kind of firmware do you plan to install?
Official MIUI (Stable/Beta)
Custom (LineageOS, Pixel Experience, etc.)
Stock Android (without MIUI)
I don't know, I'm exploring options.

2. Official MIUI firmware: where to download and how to install

Xiaomi provides two types of official firmware: Recovery (installed via stock recovery) and Fastboot (requires an unlocked bootloader and PC). The former are easier to install, but not suitable for "brick" devices. The latter are versatile, but require additional tools.

You should download firmware only from official sources:

  • 🌐 Xiaomi website: new.c.mi.com/global/miuidownload – stable and beta versions are available for all regions (Global, EEA, China, Russia).

When choosing a version, pay attention to:

  • πŸ“Œ Region: China firmware may not support Google services, and Global may not support Cyrillic in system fonts.
  • πŸ”’ Android Version: For example, MIUI 14 can be both Android 12 and Android 13 based.
Type of firmwareWhere to downloadDo you need to unlock the bootloader?Data dump?
Recovery (ZIP)Official websiteNo.No (but recommended)
Fastboot (TGZ)Official websiteYes (for most models)Yeah (full wipe)
OTA-updateThrough Settings β†’ UpdateNo.No.
Castomium (TWRP)XDA, TelegramYes.Yes (required)

For installation via Recovery:

  1. Download a firmware file (e.g., miui_VEUXGlobal_V14.0.5.0.TKCMIXM_5a3b123456_13.0.zip).
  2. Rename it to update.zip and put it in the root of internal memory.
  3. Go to Settings β†’ About Phone β†’ System Update β†’ Three Dots (menu) β†’ Select a firmware file.
  4. Confirm the installation and wait for the reboot.

πŸ’‘

If after installing the firmware through Recovery, the phone is getting stuck on the Mi logo, try pinching Power + Volume up for 10-15 seconds for a forced reboot.

3. Unlocking the bootloader: step-by-step guide

Most modern Xiaomi smartphones (starting with the Redmi Note 5 and later) have a locked bootloader, which is required to unlock the firmware via fastboot or custom receptacles like TWRP. The process is officially supported by Xiaomi, but has limitations:

  • ⏳ Waiting 7-14 days: Once you have your Mi Account tied to your device, you have to wait until you unlock it (on new models, it can take up to 360 hours).
  • πŸ“± Model restriction: Some devices (e.g., POCO F1 or Mi A3) have a simplified procedure.
  • πŸ”„ Data reset: Unlocking erases all data from the device.

Instructions for unlocking:

  1. Link your Mi Account to your device: Settings β†’ Xiaomi Account β†’ Sign in.
  2. Activate USB debugging and OEM unlocking: Settings β†’ About Phone β†’ MIUI version (tap 7 times to activate Developer Mode) Settings β†’ Additional β†’ For Developers β†’ Unlock OEM (enable) and Debug over USB (enable)
  3. Download the Mi Unlock Tool and run it on PC (Windows 7+ is required).
  4. Connect the phone in fastboot mode (turn off the device, then press Power + Volume down).
  5. In Mi Unlock Tool, sign in under the same Mi Account as on your phone and keep track of the unlock status.

⚠️ Warning: On devices with MIUI 13+ and newer versions, Anti-rollback protection may work. If you try to install firmware older than the current one, the phone will lock. Check the Anti-rollback version in the firmware name (e.g., ARBv4).

Linking your Mi Account to your device|Enable debugging on USB|Enable unlocking OEM|Download Mi Unlock Tool|Prepare the cable. USB 2.0-->

4. Install firmware through Fastboot

The fastboot method is the most reliable way to flash Xiaomi, especially if the device does not turn on or requires a downgrade version.

  • πŸ–₯️ PC with Xiaomi drivers installed (you can download here).
  • πŸ“¦ Firmware in.tgz format (unpack it into a folder with the Mi Flash Tool).
  • πŸ”§ Mi Flash Tool (Version 2020 or Newer).

Step-by-step:

  1. Turn off the phone and turn it into fastboot (Power + Volume Down).
  2. Connect the device to a PC. The Device Manager should display Android Bootloader Interface.
  3. Launch the Mi Flash Tool, press Select and point the path to the unpacked firmware.
  4. Select firmware mode: Clean all (recommended); Clean all and lock (clean + lock) (official firmware only); Save user data (risky, can lead to bugs).

Flash

If the process is stuck on Waiting for device, check:

  • πŸ”Œ Cable and port USB (Try another port or cable).
  • πŸ–±οΈ Driver (reinstalle via Mi Flash Tool β†’ Driver).
  • πŸ”„ Fastboot mode (reconnect the phone while holding Volume down).
What to do if the Mi Flash Tool gives you a "can't find fastboot" error
Make sure there are no Cyrillic characters on the way to the firmware folder. Move the files to the root of the C:\miui\ drive and try again. Also check that the firmware name does not have spaces or special characters (e.g., # or!).

5. Custom firmware: TWRP and alternative OS

Installing custom firmware (such as LineageOS, Pixel Experience or crDroid) requires an unlocked bootloader and a custom TWRP recavator. This process is more risky, but allows:

  • πŸš€ Install pure Android without shell MIUI.
  • πŸ”„ Upgrade the OS independently of Xiaomi.
  • ⚑ Improve performance on older devices (e.g., Redmi Note 4X).

Installation algorithm:

  1. Unlock the bootloader (see Section 3).
  2. Install TWRP via fastboot: fastboot flash recovery twrp-3.7.0_12-veux.img fastboot boot twrp-3.7.0_12-veux.img
  3. In TWRP, run Wipe β†’ Format Data (enter yes for confirmation).
  4. Copy the firmware (e.g. lineage-20.0-20231010-nightly-veux-signed.zip) to your phone via MTP to TWRP.
  5. Install the firmware via Install β†’ Select the file β†’ Swipe to confirm.
  6. If necessary, go to GApps (Google services) and Magisk (root).

Popular custom firmware for Xiaomi:

FirmwareBasisAdvantagesSupport for models
LineageOSAOSPClean Android, regular updatesRedmi Note 7/8/9, POCO F1/F2/F3
Pixel ExperienceAOSP + Pixel-based featuresInterface like Google Pixel, GCam cameraMi 9/10/11, Redmi K20 Pro
crDroidLineageOSFlexible setup, good performancePOCO X3/X4, Redmi Note 10 Pro
MIUI EUMIUI without bloatAll MIUI features, but without advertising and Chinese servicesMost of the Xiaomi devices

⚠️ Attention: On devices with a Mediatek chipset (e.g., Redmi 9A or POCO M3), the TWRP installation process is different β€” a patch is required for boot.img through Magisk.

πŸ’‘

Custom firmware may prevent you from using banking apps (due to lack of Google certification) and some camera features (e.g. 48MP on the Redmi Note 8 Pro).

Typical errors and their solutions

Even if you follow the instructions accurately, you can get errors, and let's look at the most common ones and how to fix them.

Error: Anti-rollback protection

The reason: trying to install firmware with an older version of Anti-rollback than the current one, like if you're on an ARBv4 phone and you're trying to flash ARBv3.

Solution: Find firmware with the same or newer version of ARB. Check this in the file name (e.g., miui_VEUXGlobal_V14.0.5.0.TKCMIXM_ARBv4_...).

Error: This package is for 'veux' devices; this is a'

The reason: a firmware mismatch in the device model, for example, you downloaded the firmware for the Redmi Note 11 Pro+ 5G (veux), and you have the Redmi Note 11 Pro 5G (veuxm).

Solution: Check the code name of your model through fastboot getvar product or in Settings β†’ About Phone β†’ Model.

Error: Fastboot not recognized

Reason: The PC does not have ADB/Fastboot drivers installed or environment variables are not configured.

Solution: Install Google’s Platform Tools and add the path to the folder to the PATH variable, or use the portable version of the Mi Flash Tool.

Error: The phone does not turn on after the firmware

The reasons can range from incompatible firmware to an interrupted process.

  • πŸ”„ Go to fastboot (Power + Volume down) and repeat the firmware.
  • πŸ”§ Install firmware through TWRP (if installed).
  • πŸ“‘ Connect to EDL- Mode (requires an authorized Xiaomi account and Qualcomm boxing).
How to enter EDL-Xiaomi
1. Turn off the phone. 2. Press Volume Up + Volume Down and connect the USB cable to the PC. 3. Hold the buttons 10-15 seconds until the PC identifies the device as Qualcomm HS-USB QDLoader 9008. ⚠️ Attention: Firmware through EDL without the official Mi Flash Pro tool can lead to hardware locking the device!

7. Firmware through TWRP: nuances and tips

TWRP (Team Win Recovery Project) is a customized recovery that allows you to install firmware, make backups and recover data, but new Xiaomi devices (starting with MIUI 12) have been getting more complicated:

  • πŸ”’ Protection against resetting partitioning: After a reboot, the stock firmware can overwrite TWRP.
  • πŸ“± Dynamic Partition: On Android 10+ devices, the memory markup has changed, and older versions of TWRP don’t work.

To install TWRP on modern Xiaomi:

  1. Download the current version of TWRP for your model (for example, from twrp.me or XDA).
  2. TWRP via fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
  3. Do not restart! Immediately in TWRP, swipe Disable_Dm-Verity_ForceEncrypt.zip (disables integrity verification and data encryption).
  4. Install firmware and Magisk (if root is needed).

For devices with Dynamic Partition (e.g. Redmi Note 10 Pro or POCO X3 Pro), use special versions of TWRP with dynamic support, for example, from the developer mauronofrio.

πŸ’‘

If after installing firmware through TWRP, the phone loads into the recavator, rather than the system, check if you have flashed the vendor and dtbo (for devices on Mediatek).

8 How to Get Official MIUI Back After Custom Firmware

If you’ve been experimenting with custom firmware and want to go back to stock MIUI, follow this algorithm:

  1. Download fastboot firmware for your model from the official website.
  2. Unpack it into a folder without spaces and Cyrillic (for example, C:\miui\veux\).
  3. Put your phone in fastboot mode.
  4. Launch the Mi Flash Tool, select the firmware folder and press Clean all.
  5. After the firmware, the phone will automatically reboot to MIUI.

If the device does not turn on or hangs on the logo:

  • Repeat the firmware via fastboot by selecting Clean all and lock (this will block the bootloader back).
  • If it doesn’t work, try flashing through EDL (requires authorization).

After returning to MIUI:

  • πŸ”„ Update your system through Settings β†’ Update to the latest version.
  • πŸ”’ Check the status of the bootloader: if it is unlocked, some features (such as Mi Pay or Widevine L1) may not work.

πŸ’‘

After returning to the official firmware, you may need to re-assign your Mi Account to the device (due to an FRP reset).

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
Yes, but only official firmware via Recovery or OTA. For custom firmware or firmware via fastboot, unlocking is mandatory.
Why can't the Mi Flash Tool see the phone?
Check: Are Xiaomi drivers installed (Device Manager should display Android Bootloader Interface); Are you using a USB 2.0 port (USB 3.0 ports may not work); Are you running the Mi Flash Tool on behalf of the administrator?
How do I know if the boot loader is unlocked?
Turn off your phone and turn it on, holding Power + Volume up. If you see Unlocked with an open lock, the bootloader is unlocked.
Can I use Xiaomi on Mac or Linux?
Yes, but with reservations: For fastboot, use Google's Platform Tools. Mi Flash Tool only works on Windows, but you can use alternatives like fastboot in the terminal. Linux may require additional permissions (sudo) to work with fastboot.
What if the sensor or camera doesn’t work after the firmware?
This is a typical problem when installing custom firmware on devices with Mediatek or an incompatible version of the kernel. Solutions: Scroll down the correct version of vendor and dtbo. Check if your model supports firmware (for example, GCam may not work on the Redmi Note 9 Pro with LineageOS). Return to the official MIUI via fastboot.