Real Madrid's team showed four changes from the one that started against Real Betis on Wednesday night, with Marco Asensio, Lucas Vazquez, Nacho and Dani Ceballos replacing Luka Modric, Toni Kroos, Marcelo and Gareth Bale.
As expected, it was the visitors that dominated the ball in the early stages, but Alaves were a threat in the final third, with Munir's movement causing Sergio Ramos and Raphael Varane problems at the heart of the Real Madrid defence.
Zinedine Zidane's side made the breakthrough in the 10th minute, however, when Ceballos worked some space inside the Alaves box before finding the bottom corner with a smart finish to register his first Real Madrid goal.
Ronaldo then met a near-post Isco corner on the half-hour mark, but the number seven's effort was too high as it remained 1-0 to the visitors following a first 30 minutes that struggled to produce opportunities.
Pacheco made a decent save to prevent a Nacho header finding the back of the Alaves net in the 31st minute, but the home side were causing problems down the other end, with a succession of crosses into the Real Madrid box forcing Casemiro and Varane to both make brilliant clearances.
Indeed, Alaves deservedly levelled the scores in the 40th minute when Manu Garcia headed a wonderful Munir cross into the top corner as the Basque club registered their first league goal of the 2017-18 campaign.
Real Madrid regained the lead less than three minutes later, however, when Ceballos found the back of the net with a cool finish after Alaves goalkeeper Pacheco had failed to hold on to a Dani Carvajal cross inside his own box.
Ronaldo came close to sending Real Madrid 3-1 ahead early in the second period after collecting a brilliant pass from Carvajal, but the attacker sent his low effort just wide of the post.
Ronaldo had another opportunity in the 53rd minute after working some space just outside the Alaves box, but he missed the target once again, before Pacheco made a smart save to deny Isco, who had broken the offside trap.
Real Madrid's number seven looked certain to be sending the away side 3-1 ahead in the 63rd minute after curling a beautiful effort towards the far corner, but the post saved Alaves as the 32-year-old was denied once again.
Ramos did have the ball in the back of the Alaves net moments later, but the centre-back's header was chalked off by the referee following a foul inside the home side's penalty box.
Alaves almost levelled 20 minutes from time when Alfonso Pedraza's effort took a big deflection before heading towards the Real Madrid goal, but the woodwork saved the visitors during an end-to-end period of the match.
Ramos then had a golden chance down the other end after Pacheco spilled the ball to the Real Madrid centre-back on the penalty spot, but the Spaniard somehow fired over the crossbar as the score stayed 2-1.
Pedraza hit the Real Madrid woodwork for the second time in the 76th minute following a mistake from Varane, and a late goal or two appeared certain with both defences looking shaky in the second period.
Pacheco made two super saves to deny Vazquez and Ronaldo in the final 10 minutes, but 2-1 was how it finished as Real Madrid returned to winning ways against an Alaves side that have now lost all six of their league matches this season.
Real Madrid will now switch their attention to the Champions League as they prepare to travel to Bundesliga giants Borussia Dortmund on Tuesday night. Alaves, meanwhile, are next in La Liga action away to Levante next weekend.