Coach Jose Mourinho made a host of changes to his starting lineup for the clash, but the team did not gel well in the opening 45 minutes, dominating possession but failing to threaten in front of the visitors' goal.
The Spanish champions looked sharper after the break, upping the tempo from the first half and continuing to maintain the majority of the possession.
The goal lifted the hosts and they doubled their advantage eight minutes later, as Ozil crosses the ball to Ronaldo, who fired it in for what would be the first of three goals in 10 minutes for the Portuguese forward.
Ronaldo added his second three minutes later with a close-range header and completed his hat-trick with a penalty after Luka Modric was brought down inside the box.
Getafe had a strong spell towards the end of the game, but they were unable to test Adan and Real soon reclaimed possession.
The win moves Real Madrid to within four points of second-placed Atletico Madrid, while Getafe remain 11th in the La Liga table.