The supreme leader was killed on the first day of Israeli and US air strikes against Iran on February 28 and the funeral events will begin on Saturday in Tehran, with mass processions planned next week in Qom and Mashhad and ceremonies in Iraq.
Tehran is preparing a massive security operation for the funeral.
"The large public turnout at the funeral procession of the martyred leader and the other martyrs will, in effect, be another referendum for the Islamic Republic," Qom Friday prayer leader Ayatollah Mohammad Saidi declared to state media.
Iranian President Masoud Pezeshkian expressed profound sorrow over Khamenei's death but emphasised national fortitude, urging citizens of all backgrounds to join the procession to present a unified front to the global community.
In a statement, Pezeshkian said: "This martyrdom is not the end of the journey, but the beginning of a new chapter of national unity, resilience, and progress," pointing out that "this system rests on the firm foundations of faith, ideals, and the will of a great nation."
In Iran's theocratic system, Khamenei was not only head of state and leader of a revolutionary movement, but the representative for Shi'ite Islam's 12th imam who disappeared in the ninth century.
Khamenei's death in an enemy attack plays into a powerful Shi'ite tradition of martyrdom and mourning, in which processions of black-clad flagellants beat their chests or backs during annual religious commemorations.
That potent symbolism has been evident in the black funeral flags hanging over city streets since his death and in mourning ceremonies for him referencing the martyrdom of Shi'ism's third imam, Hossein.
Workers were stringing up new posters in Tehran proclaiming support for the new leader Mojtaba, with the images of the late Khamenei and a raised revolutionary fist behind him.
For supporters of the Islamic Republic, the talk of martyrdom is no mere rhetoric.
"These are the hardest days of my life," said Mohsen, 24, a Basij member in Tehran who asked not to give his family name.
"I do not remember the time when Imam Khomeini passed away but my father says the entire country was engulfed in grief and mourning. Today, too, people are in mourning, especially because our leader was martyred," he added.
Officials and foreign dignitaries, including from Russia and China, will offer condolences in events on Friday.
On Saturday, Khamenei's remains will be taken to a Tehran mosque for the first stop in a national funerary tour.
The bodies of his daughter, son-in-law and granddaughter, as well as the widow of the new leader, his son Mojtaba, who were all killed in the same strike, will be carried alongside.
After what authorities are billing as a massive procession in central Tehran on Monday, the remains will be taken to the seminary city of Qom, the centre of Iran's Shi'ite hierarchy, for ceremonies on Tuesday.
Ceremonies will then be held in Iraq's shrine cities of Najaf and Kerbala on Wednesday with prominent attendees from Iran's regional network of Shi'ite proxies. He will be buried on Thursday, after another procession, in Mashhad near the tomb of the Imam Reza, a figure of great devotion in Iran.
Security will be tight, with temporary airspace restrictions in place over Tehran and other cities and threats of a powerful response if either the United States or Israel resumes attacks.