Toni Kroos had Madrid's first chance of the evening, but after being picked out on the edge of the box he fired a strike wide of the post.
Elche captain Albacar stepped up to the spot and made no mistake with a composed finish into the top corner.
The referee then awarded Madrid a penalty after Mosquera brought down Marcelo inside the box and Ronaldo converted from the spot.
Ronaldo scored his second of the match four minutes later when he connected with Marcelo's cross, before planting a header into the corner of the net.
The Portuguese came close to a third goal when his powerful free kick was beaten away by Herrera and moments later the keeper denied a close-range attempt from Kroos.
Sergio Ramos saw a header saved by the keeper just before half time, as Madrid held on to take their two-goal advantage into the break.