1. Open the disk image (.dmg file) and find  Software Update file (.ipsw) for your device. Drag it to the location of your choice. (Windows users will need a tool like 7-Zip, and will have to open the .hfs file inside .dmg)
  2. Open iTunes on your computer, connect your iDevice and select it.
  3.  Click Restore button [Hold down the option key (for OS X) or the shift key (for Windows)].
  4. Browse the downloaded .ipsw and wait for it to get installed.

Thats it! Now you have iOS 8 on your device. Later you can restore the backup and sync with iTunes.