Luxembourg went into the game full of confidence after winning 1-0 at Ireland and they took a shock lead against the European champions when Portuguese-born Gerson Rodrigues, who scored against Ireland, glanced in a header on the half-hour mark.
Portugal went close to levelling on two occasions before Diogo Jota headed in their equaliser in the second minute of added time at the end of the first half.
Ronaldo, who had been denied a goal in the 2-2 draw against Serbia on Saturday despite the ball clearly crossing the line, put Portugal in charge early in the second half, firing into the far bottom corner after combining with Joao Cancelo.
Ronaldo should have scored again later in the half when the ball landed at his feet following a terrible Luxembourg backpass but Portugal's all-time top scorer shot straight at Anthony Moris, who saved the striker's second attempt immediately after with his feet.
Substitute Joao Palhinha put Fernando Santos's side further ahead in the 80th minute by heading home a Pedro Neto corner, also scoring for the first time for his country, while the visitors' task got easier when Luxembourg's Maxime Chanot was sent off for a second booking in the 87th.
The victory lifted Portugal to the top of Group A on seven points after three games, level with Serbia, while Luxembourg are third with three points.
Despite the win, Portugal coach Santos was fiercely critical of how his side started the game.
"We spent the first half an hour playing at walking pace, with no intensity in either end of the pitch. I had to tell the players that we wouldn't win the game on quality alone and had to add intensity to our play," he said.
"If we only rely on our quality, any opponent can cause us difficulties. We suddenly remembered that, we grew into the game and got the equaliser which was vital.
"In the second half we won every ball, we played with intensity and suddenly Luxembourg looked like a different team."