The visitors took a shock lead after 15 minutes through Riki but Madrid quickly bounced back with Ronaldo hitting his first from the penalty spot after Angel Di Maria was felled.
It was Di Maria himself who put his team ahead and then Ronaldo got his second shortly before the break.
With Madrid controlling the game Pepe headed home and Ronaldo scored another penalty in the second half to complete the rout and remain eight points behind Barcelona who beat Sevilla 3-2 on Saturday.
While Barca have won all six of their opening games, Madrid made a stuttering start but will now go into next weekend's El Clasico with back-to-back wins and Ronaldo hitting form.
"We know that it is going to be difficult against Barcelona and we are away from home but we have to be concentrated and confident that we can win there. We will go out to win," said Ronaldo.
"We didn't start with the right mentality against Deportivo but after we went 1-0 down we made a good comeback. We are doing okay but we know that we cannot afford to drop any more points."
Deportivo coach Jose Luis Oltra admitted that it was a poor performance.
"We didn't even deserve to go 1-0 in front as we had done nothing up to then," he said.
"We have to pick ourselves up now and correct the errors but I don't think it will affect us badly the size of the scoreline.
"This kind of result can happen but I would have preferred it if we had been more courageous and taken the game to them."
Real coach Jose Mourinho chose to rest Xabi Alonso and Alvaro Arbeloa and, in a new-look midfield, Sami Khedira was joined by Luka Modric in the centre, who up until Sunday had played further forward.
At the back, Sergio Ramos switched to right back with Raphael Varane coming into the centre.
Madrid had plenty of early pressure with Ronaldo having a snap shot after 10 minutes which keeper Daniel Aranzubia got down well to block and then the Portuguese fired wide from the edge of the area.
The visitors had seen little of the ball but went ahead through practically their first attack thanks to a Madrid defence which had gaping holes.
The ball was played into Riki who found plenty of space between Varane and Pepe and then slotted into the corner.
Di Maria was lively in attack and seemed the most likely to offer a response.
He chipped over the crossbar from a tight angle and then won a penalty after being pulled down by Manuel Pablo which was dispatched by Ronaldo.
It was Di Maria who then put Madrid ahead with a clinical finish inside the area after a fine through ball from Modric.
While his big rival at Barcelona Lionel Messi has continued his blistering form this season, it has not been the same for Ronaldo who has not reached his usual standards, claiming that he was unhappy.
He lacked his killer touch after bursting past Manuel Pablo after 32 minutes as he fired wide but he showed desire to pounce and extend Madrid's lead before the break.
Sergio Ramos' shot was well saved by Aranzubia and Ronaldo was the first to react as he dived in to head the ball over the line.
Kaka was given a rare appearance after the break and Alonso was also introduced as Madrid were able to stroll in the second half with Deportivo offering little.
Pepe headed in an Alonso free-kick after 65 minutes and then Ronaldo got his third of the night again from the penalty spot after a handball by Evaldo Santos.
Atletico Madrid won their fifth league game in succession as a Raul Garcia header gave them a 1-0 victory over Espanyol.
The in-form midfielder struck after 30 minutes and it means that Atletico haven't dropped a point since their opening day draw with Levante but the situation is getting desperate for Espanyol who have just one point.
Earlier Valladolid demolished Rayo Valladolid 6-1, Osasuna made easy work of Levante with a 4-0 victory while Granada came out on top 2-1 against Celta Vigo.