Gedi arrived in the southern Somali town of Jowhar, 90km northwest of the capital Mogadishu, on Saturday to relocate a seven-month old government from the Kenyan capital, the president's spokesman Yusuf Ismail said.
Hundreds of Jowhar residents lined the road to the airport to welcome Gedi, chanting slogans in support of the government's relocation to Somalia.
The country has been without a central government since clan-based regional leaders overthrew dictator Mohamed Siad Barre in 1991. The warring factions then turned on each other, plunging the country of seven million into chaos.
Since last year, when Somalia's parliament and government were formed after two years of peace talks, they have been based in Kenya because Somalia was considered too unsafe.
Somali President Abdullahi Yusuf Ahmed has said Mogadishu is still too unsafe.
On Monday, Kenyan President Mwai Kibaki hosted a farewell reception for his Somali counterpart, who declared it was the last day he would run his country's affairs from Nairobi.
Ismail said Yusuf is currently in Yemen, where he was meeting parliament Speaker Shariif Hassan Sheikh Aden, who has accused the president of violating Somalia's transitional charter by calling sittings of parliament without the speaker's authority.
Aden relocated to Mogadishu last month.
Lawmakers remain split over whether the transitional government should locate to Mogadishu, or operate from the towns of Jowhar and Baidoa, 250km northwest of Mogadishu.