The Argentine’s first-half spot-kick was excellently saved by Fernando Pacheco after Gerard Pique was fouled.
He gave them the lead after the break when his shot from Gerard Deulofeu’s ball was deflected in, and scored a second from Jordi Alba’s headed pass.
Messi, who has scored a record 351 La Liga goals, had the chance for a hat-trick but his 20-yard shot hit the bar.
Barca are set to sign Borussia Dortmund forward Ousmane Demeble for a fee which could rise to 147m euros (£135.5m), subject to having a medical on Monday.
They did bring on another summer signing, Paulinho, for his debut late on although the £36.4m recruit from Guangzhou Evergrande did not have time to make an impact.
Alaves, who were beaten by Barca in last season’s Copa Del Rey final, brought on Enzo, the son of Real Madrid boss Zinedine Zidane, for his debut in the second half.