From the beginning of the world until this present era, the Ka‘bah was reconstructed five times.
Initially, it was constructed by Hazrat Aadam (‘alaihis salaam). Hazrat ‘Abdullah bin ‘Amr bin ‘Aas (radhiyallahu ‘anhuma) reports that Rasulullah (sallallahu ‘alaihi wasallam) said, “Allah Ta‘ala sent Hazrat Jibraa’eel (‘alaihis salaam) to command Hazrat Aadam (‘alaihis salaam) to build the Ka‘bah. When Hazrat Aadam (‘alaihis salaam) completed building the Ka‘bah, he was instructed to walk around it in tawaaf. He was also informed, ‘You are the first man and this is the first house erected for people to worship Allah Ta‘ala.’”
When the flood struck in the era of Nabi Nooh (‘alaihis salaam), no sign or trace of the Ka‘bah was left. Nabi Ebrahim (‘alaihis salaam) was then commanded to construct the Ka‘bah for the second time. There was no trace of even the foundation left behind. Hazrat Jibraa’eel (‘alaihis salaam) came and marked the original foundation. Subsequently, Hazrat Ebrahim (‘alaihis salaam), with the assistance of Hazrat Ismaa‘eel (‘alaihis salaam), began reconstructing the holy Ka‘bah.
(Extracted from Seeratul Mustafa 1/113)