Xiaomi Mi5 and some previous types are sold with locked bootloader conditions. This makes the phone more secure, but for some people who like to experiment of course this is difficult.

I am one of them who feel complicated. When going to experiment try custom rom, first you need to unlock bootloader to be able to install Custom Recovery like TWRP or others, which will be used in custom rom installation process. You will find the summary of the steps below.

To unlock the bootloader you should contact Xiaomi via this link, and fill in the required data form. If approved, then you will receive information via SMS. After receiving the SMS, the step to unlock the bootloader is continued by running the Mi Unlock application via Fastboot.

My experience, receive the SMS 7 – 10 days after request. But yesterday I received the SMS just couple minutes after registration. When running the unlock process using Mi Unlock, there is fail notification. Lucky yesterday this process went smoothly.

Now the bootloader is unlock, so you can install custom recovery like TWRP. But I suggest using ZCX-TWRP, because I get stuck when using the standard one. On the page you can find how to install too. After installation process done, go to recovery mode to test and check the installation done well. See the Chinnese character, no worry, just click and find the globe icon and choose English.

LineageOS for Mi5

You can find the source from here.
Download link, how to install, and others related info.
Maybe some people already know that LineageOS is a development and new name of CyanogenMod (CM). Below the Youtube video about LineageOS for Mi5 from That Geeky Guy.

Now here the summary of steps above, from unlock bootloader to install LineageOS for Mi5: