How to install a bootloader and firmware on Xiaomi: from unlock to firmware

Installing alternative firmware or updating official software on Xiaomi devices is a process that requires attention to detail. Many users face the need to unlock the bootloader before firmware, but not everyone knows how to do it safely. In this article, we will discuss all the steps from the preparation of the device to the final installation of the firmware, including nuances for different models of Redmi, POCO and Mi.

The process may seem complicated, but with the right approach, it is available even to beginners, the main thing is to follow the instructions and take into account the features of a particular model, since, for example, the Xiaomi 12T and Redmi Note 10 Pro have different unlock mechanisms.

Note that installing informal firmware (like LineageOS or Pixel Experience) may take you out of warranty, but for many users, itโ€™s the only way to get current updates on older devices or expand functionality. If your goal is simply to update official software, the process will be easier, but it will also require caution.

๐Ÿ“Š What kind of firmware do you plan to install?
Official MIUI
LineageOS (Pixel Experience)
Global version instead of Chinese
Another.

1. Device Preparation: What to Do Before Unlocking the Booter

Before you start unlocking Bootloader, you need to follow a few critical steps, neglecting them can lead to a blink (complete failure) of the device or loss of data.

First, back up all your important data. Unlock the bootloader and firmware reset the device to factory settings. Use Mi Cloud, Google Drive, or local storage.

  • ๐Ÿ“ฑ Contacts and Messages (Export through Settings) โ†’ Google โ†’ Backup)
  • ๐Ÿ“ท Photos and videos (copy to PC or cloud)
  • ๐Ÿ”‘ Passwords from apps (write down or use password manager)
  • ๐ŸŽฎ Save games (if cloud backup is supported)

Second, check the MIUI version and the device model. This is critical, because the firmware is strictly model-specific. You can find out the version in Settings โ†’ About the phone. Write down the exact model name (e.g. Redmi Note 11 Pro 5G codenamed veux).

Also make sure that the device has enough battery power (at least 60%) interrupting the process due to discharge can make the phone unusable for further use.

โš ๏ธ Note: If your device was purchased in China, it is likely that it is running Chinese firmware without Google services, in which case, after unlocking the bootloader, you will need to install a global version. MIUI or custom firmware with GApps.

2 Unlock the bootloader on Xiaomi

Unlocking Bootloader is a must-have step for installing any unofficial firmware or even some official updates. Xiaomi allows unlocking, but the process requires confirmation through a Mi Account.

First, you need to link your Mi Account to your device:

  1. Go to Settings โ†’ Xiaomi Account and log in.
  2. Turn on data synchronization.
  3. In Settings โ†’ Additional โ†’ For developers, activate the options for debugging over USB and unlocking OEM.

Next, download the official Mi Unlock Tool from Xiaomi (Windows only). Make sure you have ADB and Fastboot drivers installed. Connect your phone to your PC in Fastboot mode (click Volume Down + Power When the device is off).

Launch the Mi Unlock Tool, log in to the same Mi Account as your phone, and follow the instructions.

  • ๐Ÿ”— Linking an account to a device can take up to 72 hours (according to Xiaomi rules).
  • ๐Ÿ“ฑ In some models (for example, POCO F4) Additional confirmation is required through SMS.
  • ๐Ÿ”ง If the utility gives you a Couldnโ€™t unlock error, try using a different version of the program or try again later.

Link Mi Account to your device

Enable USB debugging and OEM unlocking

Download Mi Unlock Tool from the official website

Install ADB/Fastboot drivers

Charge your phone at least 60%-->

โš ๏ธ Note: Once the bootloader is unlocked, all data, including files in internal memory, will be deleted from the device. Anti-Rollback protection may also work if you try to install firmware older than the current version.

3. firmware selection: official MIUI vs custom builds

Once you unlock the bootloader, you need to decide on the type of firmware. Each option has pros and cons:

Type of firmwareAdvantagesDeficienciesWho's right for?
Official MIUI (Global/Chinese)Stability, support OTG-Updates, the guarantee is maintainedLots of Bloatware, Limited CustomizationFor those who value stability,
MIUI EU (unofficial)No Ads, Weekly Updates, More FeaturesMaybe less stable, no. OTA-updateExperienced users, lovers of new features
Castomium (LineageOS, Pixel Experience)Clean Android, Long-Term Support, No BloatwareSome functions may not work (NFC, camera)Enthusiasts, owners of old devices
Port firmware (from other devices)Unique functions, experimentsHigh risk of brick, bugsDevelopers, testers

For most users, the best choice is the global version of MIUI (if it was originally Chinese) or MIUI EU for those who want to get rid of advertising. Cast firmware like LineageOS will work if your device no longer receives updates from Xiaomi, but be prepared for possible hardware problems (for example, the broken Widevine L1 for Netflix in HD).

Download the firmware only from verified sources:

  • ๐ŸŒ Official: en.miui.com (global) or miui.com (Chinese)
  • ๐Ÿ”ง Informal MIUI EU: xiaomi.eu
  • ๐Ÿค– Castomy: XDA Developers or LineageOS

๐Ÿ’ก

Before downloading the firmware, check that it is compatible with the code name of your device (for example, surya for POCO X3). Installing firmware from another model will lead to a blink!

4. Install firmware via Fastboot or Recovery

There are two main ways to install firmware on Xiaomi: through Fastboot (recommended for official firmware) and through Recovery (convenient for custom builds).

Method 1: Installation via Fastboot (for official firmware)

  1. Download the firmware in.tgz or.zip format and unpack it into a folder.
  2. Connect your phone to your PC in Fastboot mode (clip Volume Down + Power).
  3. Launch the file. flash_all.bat (Windows or flash_all.sh (Linux/Mac).
  4. Wait until the process is completed (usually 5-10 minutes).

Method 2: Installation with Recovery (TWRP)

  1. Install custom recovery TWRP via Fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
  2. Copy the firmware (.zip format) on your phone or flash drive.
  3. In TWRP, select Install, specify the firmware file and confirm the installation.
  4. After installation, run Wipe โ†’ Format Data (required for custom firmware!).

If you install custom firmware, additional customization may be required after the first run (e.g. installing GApps or fixing access rights through Magisk).

What to do if the firmware is not installed?
If the installation process is interrupted with an Error 7 or Failed to mount /system error, check: 1. firmware compatibility with the device model. 2. integrity of the downloaded file (check the hash amount). 3. Free space in memory (requires a minimum of 4-5 GB). 4. TWRP version (new devices may require a special build).

5. Solving problems after firmware

Even if installed correctly, firmware can get into trouble, and here are the most common ones and how to fix them:

Problem 1: The phone doesnโ€™t turn on or hangs on the MI logo

    Problem 2: Mobile network or Wi-Fi is not working

    • ๐Ÿ“ถ Make sure the firmware supports your region (e.g., the global version for Europe).
    • ๐Ÿ”„ Reset network settings in Settings โ†’ SIM-maps and mobile networks โ†’ Resetting settings.
    • ๐Ÿ“ก Refuse Modules and Vendor via Fastboot.

    Problem 3: Constant reboots (bootloop)

    • ๐Ÿ› ๏ธ Remove the cache through TWRP (Wipe โ†’ Advanced Wipe โ†’ Dalvik/ART Cache + Cache).
    • ๐Ÿ”„ Reinstall the firmware without the Reboot after installation checkbox, then manually restart.
    • ๐Ÿ”ง Check if the installed kernel or Magisk conflicts with the firmware.

    โš ๏ธ Note: If biometric sensors (fingerprint, facial recognition) have stopped working after firmware, most likely, a firmware with an incompatible vendor was installed. vendor.img stock-stack.

    6. System optimization after firmware

    After successful firmware installation, several steps are recommended to improve performance and stability:

    1. Superuser rights setting (Root)

    If you have installed Magisk, check it through the Magisk Manager app. Update the modules and hide root from apps that block it (such as banking):

    • ๐Ÿ”’ Enable Magisk Hide in the settings.
    • ๐Ÿ”„ Update Magisk via Direct Install in the app.
    • ๐Ÿ“ฑ Install modules to improve functionality (for example, ViPER4Android sound-wise).

    Calibration of the battery

    After the firmware is installed, the charge level display may be lost.

    1. Discharge the phone before automatically shutting down.
    2. Charge up to 100% without interruption (use the original adapter).
    3. Reset your battery statistics via TWRP (Wipe โ†’ Battery Stats).

    3. Optimization of productivity

    • ๐Ÿš€ Enable Advanced Performance Mode in Settings โ†’ Special facilities โ†’ Font size and display (for MIUI).
    • ๐Ÿงน Disable unnecessary system applications through ADB: adb shell pm uninstall --user 0 com.miui.analytics
    • ๐Ÿ”„ Use Greenify to hibernate background apps.

    ๐Ÿ’ก

    Once you have custom firmware installed, be sure to check the basic features: calls, mobile internet, Wi-Fi, Bluetooth and camera. If something doesn't work, go back to stock firmware or look for an alternative build.

    7 How to return the official firmware if something went wrong

    If after experiments with firmware, the device began to work unstable or you want to return the warranty, you can restore the official software.

    Step 1: Download the stock firmware

    Find the latest stable version of MIUI for your model on Xiaomiโ€™s official website. Pay attention to the region (e.g. Global, EEA, China).

    Step 2: Switch through the Mi Flash Tool

    1. Unpack the downloaded archive with firmware.
    2. Install the Mi Flash Tool on your PC.
    3. Connect your phone in Fastboot mode.
    4. In the program, select a firmware folder and press Refresh, then Flash.
    5. Select Clean All (Full Cleaning) mode.

    Step 3: Unlock the bootloader back (optional)

    If you want to hide the fact of unlocking (for example, for warranty repairs), you can re-lock the bootloader through the Mi Unlock Tool. However, this is risky and can lead to a blink if the firmware is not completely stock.

    โš ๏ธ Note: When you return to the official firmware, all data will be deleted, and the unlocked bootloader can remain in the system (this is visible in Fastboot under the label unlocked.

    FAQ: Frequent questions about Xiaomi firmware

    Can I use Xiaomi without unlocking the bootloader?
    No, any unofficial firmware or even some official updates (e.g., switching from Chinese to global) require unlocking Bootloader, except for OTA updates within one version of MIUI.
    How long does it take to unlock the bootloader?
    The process of unlocking through the Mi Unlock Tool takes 5-10 minutes, but it can take up to 72 hours to link a Mi Account to a device (by Xiaomiโ€™s rules), which is a period of protection against theft.
    What Xiaomi models can not be stitched with custom firmware?
    Technically, you can flash any device, but some models (such as the Xiaomi 13 Ultra or Mix Fold 3) may not work some of the features due to the closed source driver code, and devices with MediaTek processors (such as the Redmi Note 12) are more difficult to sew due to limited support for custom recavators.
    How to check if the bootloader is unlocked?
    Turn off your phone and press Volume Down + Power to log into Fastboot. If there's an unlocked sign at the bottom of the screen and an open lock icon, the bootloader is unlocked.
    Can I get root rights without custom firmware?
    Yes, with Magisk you can get root rights even on the official firmware, but this still requires unlocking the boot boot.img and patching boot.img through Magisk Manager.