The Mets celebrated their home opener in matter-of-fact fashion Friday, raising their National League pennant in a low-key pregame ceremony. Then they did precisely the kind of thankless, unglamorous work that led them to that championship.

In beating the outgunned Phillies, 7-2, the Mets replicated a successful formula, pounding on a weaker team within their division while protecting their home field.

“Those were keys to our success last year,” captain David Wright said. “So it’s nice to get off to a good start.”

StatsMets top Phillies in home opener, 7-2

Jacob deGrom endured an odd afternoon. With his wife expected to go into labor at any moment — and with deGrom determined to witness the birth of his son — the righthander’s outing was cut short because of an unforeseen development: tightness in his right lat.

But even with a fastball that was missing its typical velocity — an issue that has dogged him this year — deGrom held the Phillies to one run in six innings. He struck out six and walked none.

“It’s all right,” deGrom said of his lat muscle. “It got a little tight in the sixth inning and I didn’t want to push it too much.”

advertisement | advertise on newsday

With a swirling wind on a 47-degree afternoon, Terry Collins pulled deGrom after 76 pitches, a move the team described as “precautionary.” Collins said he won’t know the seriousness of the injury until Saturday.

But even with the uncertainty looming over deGrom, the Mets (2-1) took care of business against the bungling Phillies (0-4), who did little to dispel what have been unflattering preseason predictions.

Michael Conforto continued his scorching start, equaling a career high with three RBIs. Neil Walker drove in two runs, giving him five RBIs in his first three games.

Mets videos

In the sixth, Walker snapped a 1-1 tie with a single up the middle that drove in Lucas Duda, who led off the frame with a double off Phillies starter Jerad Eickhoff. Conforto followed by rifling a double down the rightfield line to drive in Walker from first.

The Mets drew away with four runs in the seventh, which included another run-scoring single by Walker and a two-run single by Conforto.

“Yeah, it’s a great feeling,” said Conforto, who remains in a platoon though he has arguably been the most productive bat in the lineup. “Helping the team put runs on the board and kinda give us an extra cushion.”

An announced sellout of 44,099 — the largest regular-season crowd in Citi Field history — turned out to celebrate last year’s NL championship. They wound up witnessing what could be the template for a repeat, with the Mets taking advantage of a club mired in the darkness of rebuilding.

During pregame introductions, trainer Ray Ramirez received a warm ovation, a marked departure for the longtime target of boobirds. As expected, Matt Harvey heard plenty of cheers, though he may have been trumped by Noah Syndergaard.

advertisement | advertise on newsday

Bartolo Colon, the cult hero, drew the loudest ovation of all.

Meanwhile, a mostly anonymous group of Phillies inspired little vitriol, an indictment of just how far the Mets’ once-bitter division rivals have fallen.

Shortstop Freddy Galvis dropped an easy force at second base, leading to an unearned run. And in the eighth, Cesar Hernandez took off from first base, not realizing that the infield fly rule had been called. The mistake bailed out David Wright, who dropped Odubel Herrera’s pop-up into the wind.

The Mets improved to 48-28 against the Phillies since 2012. More importantly, they offered a clear sign that they’ll build off the 47-29 mark they posted against NL East rivals in 2015.

“We really played well in our division,” Collins said. “And we’ve got to do that again.”