I've found a lot of instructions on the internet with a lot of very pervasive and superfluous instructions, and wanted one that was the least destructive with the fewest amount of required steps. These are the steps I use for my Nexus 5:
Firstly, download the latest adb and fastboot binaries (latest is best).
Download SuperSU: http://download.
Download ClockworkMod Touch recovery: https://www.(Optionally) download the factory images: https://developers.
Your phone needs to be in fastboot mode for any fastboot command to work... try Power+VolDown at startup for Nexus 5.
(Will wipe ALL data, you can always lock again without wiping, may also void your warranty)
fastboot oem unlock
1) Boot up your device at least once! (after unlock or factory images re-install)
2) boot into custom recovery: (from fastboot)
fastboot boot recovery-
You could also flash and then boot recovery: (since rooting prevents OTA updates from working, and requires a re-flash of the system partition anyway, this is not that big a deal anymore)
fastboot flash recovery recovery-clockwork-touch-XXXXX.img
3) Side load it:
(make sure you are "installing from zip" on CWM recovery using "sideload" option)
adb sideload UPDATE-SuperSU-XXXXX.zip
NOTE: You should see no errors when you now exit CMR and reboot... if you do, you've done something wrong and not followed these instructions to the letter. It also may ask to fix root, but I found this was not needed for any of the times I've done this.