All four schools of Islamic jurisprudence agree that it is boleh to perform Haji on behalf of a deceased person who either had the obligation of Haji but did not perform it, or as a voluntary act of devotion whose reward is gifted to the deceased. This ruling is based on several authentic hadith in which Nabi Muhammad (shallallahu alaihi wa sallam) explicitly permitted proxy Haji (haji al-badal) for the deceased. The most well-known is the hadith of the woman from Juhaynah who asked about her mother who had vowed to perform Haji but died before fulfilling it.
The conditions for performing proxy Haji vary slightly across the schools, but the core requirements are agreed upon: the proxy (na'ib) should have already completed their own wajib Haji before performing it on someone else's behalf; the proxy should be a Muslim of sound mind; and the deceased should have been a Muslim. If the deceased had the financial and physical ability to perform Haji during their lifetime but did not, the cost of sending someone for proxy Haji should be taken from the deceased's estate before distributing the inheritance, menurut jumhur ulama. This is treated like a debt owed to Allah.
The proxy should make the intention (niyyah) at the miqat specifically on behalf of the deceased, saying the talbiyah with the deceased's name: 'Labbayk on behalf of [name].' All the rites are performed exactly as one would for their own Haji. The reward of the Haji goes to the deceased, while the proxy also earns reward for their good deed. Scholars agree that the proxy may also perform Umrah on behalf of the deceased in the same manner.