Skip to content
DownloadAPK

How to Install a Custom ROM on Android: Complete 2026 Guide

Step-by-step guide to installing a custom ROM on Android in 2026, covering bootloader unlocking, TWRP, GrapheneOS, LineageOS, post-install security hardening, and common troubleshooting fixes.

Installing a custom ROM is one of the most impactful things you can do with an Android device. It can extend the life of a phone no longer receiving official updates, remove pre-installed bloatware, or replace the entire OS with a hardened, privacy-focused alternative. The process involves real risks - data loss, a temporarily unbootable device (a “soft brick”), and the loss of certain hardware-backed security features if done carelessly. This guide walks through every stage in the correct order, explains what each step actually does, and points you to the resources you need for your specific device.

What You Need Before You Start

Preparation prevents most of the failures people encounter when flashing a custom ROM. Gather everything below before touching a single command.

Hardware and software requirements:

  • A compatible Android device with an unlockable bootloader. Google Pixel phones are the gold standard for custom ROM support. Other well-supported lines include Fairphone, OnePlus (older models), and some Samsung devices - note that Samsung uses Download Mode with Odin or Heimdall to flash firmware, and bootloader unlock on Samsung is handled through the Settings menu (OEM unlocking toggle), subject to Knox and carrier restrictions.
  • A PC or Mac running ADB and fastboot. Install the Android SDK Platform Tools from the official Android developer site (developer.android.com/tools/releases/platform-tools). Avoid third-party ADB installers.
  • A USB cable that reliably transfers data - not just charging. Cheap cables cause mid-flash failures.
  • The correct ROM image for your exact device model and region. A build for the Pixel 8 will not work on a Pixel 8 Pro.
  • The correct TWRP image if your device uses it, or the vendor’s boot image for patching with Magisk if you want root.
  • At least 70% battery charge on the device.

Back up everything. Unlocking the bootloader performs a factory reset. Use Google’s built-in backup before proceeding. Note that adb backup was deprecated starting in Android 12 and is unreliable on modern devices - for a more complete local backup including app data, see our guide on ADB commands for Android power users, which covers alternatives such as third-party ADB backup tools.

Step 1: Enable Developer Options and OEM Unlocking

On your Android device, go to Settings > About phone and tap Build number seven times until you see “You are now a developer.” Then navigate to Settings > Developer options and enable two toggles:

  • USB debugging - allows ADB communication with your PC
  • OEM unlocking - permits the bootloader to be unlocked via fastboot

OEM unlocking may be greyed out if your carrier has locked the device at a network level, or if the device has an enterprise management profile (MDM) enrolled. If either condition applies, the device cannot be unlocked without removing those restrictions first.

Connect the phone to your PC and confirm the ADB connection:

adb devices

The device should appear with the status “device” (not “unauthorized”). If it shows “unauthorized,” check the phone for the USB debugging authorization prompt and accept it.

Step 2: Unlock the Bootloader

Boot into fastboot mode. On most devices, this means running:

adb reboot bootloader

Alternatively, hold the Power + Volume Down buttons while the device is off (the button combination varies by manufacturer - check your device’s documentation).

Once in fastboot mode, confirm the PC sees the device:

fastboot devices

Then issue the unlock command. For most devices this is:

fastboot flashing unlock

On older devices running Android 6 or earlier, the command may be fastboot oem unlock. The fastboot flashing unlock command was introduced in Android 7 (Nougat). The device will display a warning screen explaining that unlocking erases all data and disables verified boot. Use the volume keys to navigate to “Unlock the bootloader” and confirm with the power button.

The bootloader is now unlocked. The device will reboot and perform a factory reset. You will see an orange or yellow warning message on future boots - this is normal and expected behavior on an unlocked device, documented in the Android Verified Boot (AVB) specification.

Step 3: Choose Your Recovery and ROM

This step varies significantly depending on which ROM you are installing.

ROMRecovery neededTarget devicesNotes
LineageOSTWRP or LineageOS RecoveryWide range of devicesCheck lineageos.org/devices/ for official support
GrapheneOSNone (uses fastboot web installer)Google Pixel 6 through 9 seriesVerified boot preserved with re-locked bootloader
CalyxOSNone (uses fastboot scripts)Google Pixel, FairphoneSupports microG for app compatibility
DivestOSTWRP or fastbootBroad older device supportFocus on long-term support for abandoned devices

If you are undecided between LineageOS and GrapheneOS, read our in-depth GrapheneOS vs LineageOS 2026 comparison before proceeding - they have very different security models and installation flows.

For LineageOS (TWRP-based flow):

Download the TWRP image for your specific device from twrp.me, or use the LineageOS Recovery image linked from the device’s lineageos.org page (recommended for newer devices where TWRP support is limited). Boot into fastboot mode and flash it to the recovery partition:

fastboot flash recovery twrp-<version>-<device>.img

For GrapheneOS (fastboot web installer):

GrapheneOS provides a browser-based installer at grapheneos.org/install/web that handles everything through WebUSB. It is the recommended method for non-technical users installing on a supported Pixel device.

Step 4: Flash the ROM via TWRP

(Skip this section if you are using GrapheneOS or another ROM with a standalone fastboot installer.)

Boot into TWRP recovery. From fastboot mode, run:

fastboot reboot recovery

Or use the button combination for your device. Once in TWRP:

  1. Wipe - perform a factory reset from within TWRP. Go to Wipe > Advanced Wipe and select: Dalvik/ART Cache, System, Data, and Cache. Do NOT wipe Internal Storage unless instructed by your ROM’s documentation.
  2. Transfer the ROM ZIP - return to the main TWRP menu, tap Install, then navigate to the ZIP file you transferred to the device. If the device was just wiped, use ADB sideload instead: on your PC, run adb sideload lineageos-<version>-<device>.zip.
  3. Flash GApps if needed - LineageOS does not include Google apps by default. If you need them, flash a GApps package (such as MindTheGapps, available at github.com/MindTheGapps) immediately after the ROM, before rebooting. If you prefer to avoid Google services entirely, skip this step and install apps via F-Droid after booting.
  4. Reboot System - the first boot after flashing a new ROM takes two to five minutes. Do not interrupt it.

Step 5: Post-Installation Security Hardening

A freshly installed custom ROM is a clean slate. The choices you make in the first hour determine how private and secure the device actually is.

Verify the installation is healthy. Check Settings > About phone to confirm the correct Android version and security patch level are shown. On LineageOS, the build date and version number appear here. On GrapheneOS, navigate to Settings > Security to verify the verified boot state shows “Green.”

Re-lock the bootloader on GrapheneOS. If you installed GrapheneOS, re-lock the bootloader after the OS is installed and verified. This restores full verified boot protection - a key security property that most other custom ROMs cannot offer because they do not ship with the device manufacturer’s keys. The GrapheneOS documentation at grapheneos.org/install covers this step explicitly.

Set up app sources carefully. The Google Play Store is not available on GrapheneOS by default (though the Sandboxed Google Play compatibility layer is available as an optional install). On LineageOS without GApps, F-Droid is your primary source for FOSS apps. For a breakdown of the trade-offs, see our comparison of F-Droid vs the Play Store.

Apply the privacy hardening checklist. After installing, review our Android privacy hardening checklist to lock down permissions, disable telemetry, and configure network-level protections.

Use a password manager. A new device means migrating your credentials. Our roundup of the best Android password managers for 2026 covers options that work fully without Google Play Services.

Common Problems and Fixes

Device shows “fastboot” but fastboot devices returns empty: Install or update USB drivers on Windows. On macOS and Linux, try a different USB port or cable.

TWRP boots but shows “Failed to mount /data (Invalid argument)”: This usually means the data partition uses a file system TWRP’s build does not support (common on newer devices with F2FS or metadata encryption). Check if a newer TWRP build exists for your device, or use a ROM-specific recovery image.

ROM boots to a black screen or bootloop after first flash: The most common cause is a mismatch between the ROM build and the device variant. Double-check the model number in Settings > About phone before flashing. Some OnePlus and Samsung devices have regional variants with different partition layouts.

“dm-verity corruption” error on boot: This appears when you flash a ROM but do not wipe the system partition first. Boot back into TWRP, perform a full Advanced Wipe (System + Data + Cache), and reflash.

Loss of banking apps or Google Pay: Apps that use the Play Integrity API (formerly SafetyNet, which Google deprecated in June 2024) to detect unlocked bootloaders or unofficial ROMs will refuse to run. GrapheneOS with a re-locked bootloader passes Play Integrity at the MEETS_STRONG_INTEGRITY level, which is hardware-backed attestation - the highest standard the API can verify. On LineageOS with an unlocked bootloader, Magisk with the DenyList and Zygisk enabled can pass the lower MEETS_DEVICE_INTEGRITY level in many cases, though this is an ongoing arms race as Google updates its attestation checks.

Installing a custom ROM requires patience and precision, but the payoff - an up-to-date, debloated Android device under your full control - is substantial. Start with a device that has first-class ROM support, follow the documentation for that specific device rather than generic guides, and verify each step before moving to the next.

Frequently Asked Questions

Will installing a custom ROM void my warranty?

Unlocking the bootloader voids the manufacturer warranty on most devices. Some manufacturers, including Fairphone, are more permissive. In practice, you can re-lock the bootloader and restore a stock firmware image before sending a device in for service, though this depends on your device and region. Check your manufacturer’s policy before proceeding.

Can I go back to the stock ROM after installing a custom ROM?

Yes, on most devices. For Google Pixels, Google publishes factory images at developers.google.com/android/images that can be flashed with fastboot to restore the device exactly to stock. For other devices, official firmware packages are typically available from the manufacturer’s support site or recognized community repositories such as XDA Forums.

Do custom ROMs receive security updates?

It depends on the ROM. GrapheneOS and DivestOS apply Android Security Bulletins quickly and are considered among the most actively patched options available. LineageOS also provides regular updates for supported devices, though patch lag varies. Abandoned or unofficial builds may receive no updates at all, which is worse from a security standpoint than remaining on an older supported stock firmware.

What is the difference between a soft brick and a hard brick?

A soft brick means the device fails to boot into Android but can still enter fastboot or recovery mode, making recovery straightforward. A hard brick means the device is completely unresponsive - no fastboot, no recovery, no display. Hard bricks are rare and usually result from flashing incompatible firmware to partitions such as the bootloader or radio. Following device-specific documentation and never interrupting a flash mid-process are the best ways to avoid both.

FAQ

Will installing a custom ROM void my warranty?
Unlocking the bootloader voids the manufacturer warranty on most devices. Some manufacturers, including Fairphone, are more permissive. In practice, you can re-lock the bootloader and restore a stock firmware image before sending a device in for service, though this depends on your device and region. Check your manufacturer's policy before proceeding.
Can I go back to the stock ROM after installing a custom ROM?
Yes, on most devices. For Google Pixels, Google publishes factory images at developers.google.com/android/images that can be flashed with fastboot to restore the device exactly to stock. For other devices, official firmware packages are typically available from the manufacturer's support site or recognized community repositories such as XDA Forums.
Do custom ROMs receive security updates?
It depends on the ROM. GrapheneOS and DivestOS apply Android Security Bulletins quickly and are considered among the most actively patched options available. LineageOS also provides regular updates for supported devices, though patch lag varies. Abandoned or unofficial builds may receive no updates at all, which is worse from a security perspective than staying on an older supported stock firmware.
What is the difference between a soft brick and a hard brick?
A soft brick means the device fails to boot into Android but can still enter fastboot or recovery mode, making recovery straightforward. A hard brick means the device is completely unresponsive - no fastboot, no recovery, no display. Hard bricks are rare and usually result from flashing incompatible firmware to partitions such as the bootloader or radio. Following device-specific documentation and never interrupting a flash mid-process are the best ways to avoid both.