1: Enable USB Debugging
On your Nexus go to Settings ->About, tap the Build number repeatedly untill you get the message “You are now a Developer”. Then head over to Settings->Developer options, then check the box marked USB debugging, which will allow your Windows PC to send commands to your device.
2: Download CF-Auto-Root
We’re going to use Android developer Chainfire’s rooting tool CF-Auto-Root, it will automate the rooting process for us. On your computer open this link and download the .zip file from the bottom of the page.
Extract the .zip file.
3: Boot your Device into Bootloader Mode
Power down your Nexus 5, then boot into bootloader/fastboot mode by holding in the Volume Down and Power key at the same time. You should see a black screen with a picture of the Android mascot on his back, you can navigate through the menu using the volume buttons.
4: Launch CF-Auto-Root
Connect your device to your PC with a micro USB cable. Now navigate to the folder where you unzipped the CF-Auto-Root file. Double click on root-windows.bat or right-click and select Open command window here.
In the command window type: root-windows.bat
Step 5: Follow the Given Instructions
The command window will guide you the rest of the way. It will first attempt to unlock your bootloader, this is a nessesary step for rooting.
Be warned: if your bootloader is not already unlocked, this process will erase all the data on your device, essentially leaving you with the original factory settings. This will also erase your usb storage (SD-Card).
Cf-Autoroot will now work for you…. Just wait till it finishes and let it do it’s magic.
Your phone will reboot with a red Android logo. Congratulations and welcome aboard. You are now rooted.