Real Sociedad hit the crossbar in the first minute but Barca then scored three times in quick succession to all but end the match before half-an-hour at the Nou Camp.
Summer signing Neymar, whose only previous goal for Barca was in the Spanish Supercopa against Atletico Madrid, opened the scoring in the fifth minute, Messi doubled the lead three minutes later and Sergio Busquets made it 3-0 in the 23rd minute.
Sociedad pulled a second-half goal back through Alberto De la Bella and briefly threatened to make further inroads, but they could not find another breakthrough and Barca wrapped up the scoring through substitute Marc Bartra with 13 minutes left.
"I think we played a good match, especially in the first half. I'm satisfied with the team," said coach Tata Martino, who added that "we aim to play like this always, but it's not easy. We also aim to work in other variables like changes of pace and a more vertical approach."