Android Rooting will void phone's warranty. We are not responsible for any damage or data loss caused to your phone. Do it on your own risk.
Make sure your phone is charged 70% at least.
Back up all your phone data.
You must install few drivers before rooting rooting your Nexus 5, install Universal_Naked_Driver.zip. Here is how you install these drivers.
Follow these steps carefully !
1. Connect your phone to PC through USB cable.
2. Enable USB debugging in your phone settings > developer options.
3. Download CF-auto-root to your windows pc from here.
4. Extract the folder.
5. Now power off your nexus 5 & press the volume down and power button together, you should see a black screen with a picture of the Android mascot on his back.
6. Now navigate to the folder where you unzipped the CF-Auto-Root file. While within the the folder, hold down the Shift key, right-click, then select Open command window here.
7. In the command window type: root-windows.bat
8. This process will wipe all your data leaving you with original factory settings.
Your phone will reboot with a red Android logo. If you find Super SU or Super User app in your phone's app drawer that means that your phone is rooted!!