1. The firmware is actually a lot, one of the most popular is CyanogenMod, AOKP, MIUI, and so on. The site firmware you have to download the zip file with the firmware for your specific device! Never sewn file is not intended for your device, or run the risk of killing your phone or tablet permanently. Save the downloaded the zip file with the firmware on the internal SD card of your device.

2. Most of the custom firmware, but not all, require even after installation and setup google apps, or abbreviated as they are called gapps. Download gapps for your firmware and reset the zip file with them on the inside of the card of your device. Usually gapps can download the same place where you shake your firmware. Carefully read all the site where rocked firmware as some firmware do not require gapps, as they are already included in the firmware itself.

3. Once you have dumped the firmware file and gapps on internal SD card of your device, you need to boot mode recovery. On most Samsung devices (and not only) to be loaded into recovery mode it is necessary to turn the device off, and at the same time hold the three keys at once: Home + Sound button up + power button. After that, your phone will boot into Recovery mode and you'll see a menu that you set recovery (or TWRP or ClockworkMod). You can also boot into recovery mode directly from ROM Manager or GooManager, just tapnite in the menu at the appropriate point and the phone itself is loaded to the desired mode.

4. After loading the menu recovery, if you used ClockworkMod, then use the buttons to navigate the sound (up / down), and the adoption of the selected item the power button. In all menus TWRP touch, so you can just press your finger on the desired button.

So, if you boot into ClockworkMod recovery, then you need to run the following commands in turn is precisely as it is written:
- Wipe data / factory reset ---> Yes - Wipe all user data;
- Wipe cache partition ---> Yes - Wipe Cache;
- Advanced ---> wipe dalvik cache ---> Yes - Wipe Dalvik Cache;
- Install zip ---> choose zip from sdcard. Here you will have to select the zip file with the firmware that you previously got rid of on the internal SD card, and then wait for the installation (it may take some time);
- This item is optional, some recommend to reboot after installing the zip file with the firmware, and then again to boot into recovery for installation gapps, but I've just installed without rebooting. In any case, a reboot does not hurt;
- Install zip ---> choose zip from sdcard. Here again, select the zip file with gapps before you took off on an SD card, and then wait for the installation;
- Go back to the main menu ClockworkMod recovery and select "reboot system now".

Everything you have just installed a custom firmware for your device via ClockworkMod recovery.

Now, if you use TWRP, after the boot menu rekaveri TWRP you need to do the following:
- Wipe ----> Swipe To Factory Reset, then return to the main menu TWRP;
- Install ----> select the zip file with the firmware that you previously dropped on the inside the SD card of your device and click Swipe To Confirm Flash if you want to reboot after installing the firmware, but if you want to immediately install and gapps, instead Swipe To Confirm Flash, click Add More zips and select the zip file with gapps. Then you can click Swipe To Confirm Flash and firmware with gapps are sewn one by one. The flash may take some time, do not interrupt it in any way.
- Reboot system;

All you have installed the custom firmware on your device using TWRP.
Untested firmware
New firmware