During his youth, Olajuwon was a soccer goalkeeper, which helped give him the footwork and agility to balance his size and strength in basketball, and also contributed to his shot-blocking ability. Olajuwon did not play basketball until the age of 17, when he entered a local tournament. It has been said that a coach in Nigeria once asked him to dunk and demonstrated while standing on a chair. Olajuwon then tried to stand on the chair himself. When redirected by staff not to use the chair, Hakeem could initially not dunk the basketball.
Despite early struggles, Olajuwon said: "Basketball is something that is so unique. That immediately I pick up the game and, you know, realize that this is the life for me. All the other sports just become obsolete.
Olajuwon emigrated from Nigeria to play basketball at the University of Houston under Cougars coach Guy Lewis. Olajuwon was not highly recruited and was merely offered a visit to the university to work out for the coaching staff, based on a recommendation from a friend of Lewis who had seen Olajuwon play. He later recalled that when he originally arrived at the airport in 1980 for the visit, no representative of the school was there to greet him. When he called the staff, they told him to take a taxi out to the university.
After redshirting his freshman year in 1980–81 because he could not yet get clearance from the NCAA to play, Olajuwon played sparingly as a redshirt freshman in 1981–82, and the Cougars were eliminated in the Final Four by the eventual NCAA champion, the North Carolina Tar Heels. Olajuwon averaged 8.3 points, 6.2 rebounds and 2.5 blocks, shooting 60% from the field in 18 minutes per game. Olajuwon sought advice from the coaching staff about how to increase his playing time, and they advised him to work out with local Houston resident and multiple NBA MVP winner, Moses Malone. Malone, who was then a center on the NBA's Houston Rockets, played games every off season with several NBA players at the Fonde Recreation Center. Olajuwon joined the workouts and went head to head with Malone in several games throughout the summer. Olajuwon credited this experience with rapidly improving his game: "The way Moses helped me is by being out there playing and allowing me to go against that level of competition. He was the best center in the NBA at the time, so I was trying to improve my game against the best."