The Quran claims that Abraham/Ibrahim (yes, that one) built the Kaaba with his son Ishmael. With respect to our Muslim redditors: it is more likely, of course, that building huts as places to store religious icons away from the sun was a common practice throughout Arabia and the Kabba was built by a tribe in the region (perhaps even ancestors of Muhammad's tribe, the Quraysh). The structure itself was rebuilt several times before and after the birth of Muhammad.
Regardless, the current Kaaba was built in 1629 after a flood caused the original building to collapse by the architects of Sultan Murad IV. SOURCE
Hi! There's a good answer to this question in this thread. Hope it helped!