BOSTON — Jay Gonzalez is training for next month’s Boston Marathon but he’s already begun a grueling political race with an equally uphill course.

The 48-year-old Needham resident, who served in former Democratic Gov. Deval Patrick’s cabinet, is the first Democrat, and first candidate from either major party, to officially declare for governor in 2018. Incumbent Republican Gov. Charlie Baker has yet to formally announce for a second term.

Among Democrats, Newton Mayor Setti Warren has filed papers with state campaign finance regulators and formed an exploratory campaign committee. Former state Sen. Dan Wolf of Harwich is among others considering a gubernatorial bid. But Attorney General Maura Healey and other more prominent Democrats are passing on the race.

Gonzalez said he declared early to allow more time to build a statewide campaign and introduce himself to voters. He’s traveled the state but has yet to open a campaign headquarters or hire permanent staff. The $87,000 balance in his campaign fund through mid-March was dwarfed by Baker’s $4.9 million nest egg.

Gonzalez acknowledges that unseating Baker next year won’t be easy, even in a blue state like Massachusetts.

A moderate, Baker has enjoyed strong public approval ratings since taking office. He’s distanced himself from President Donald Trump and other GOP conservatives nationally. He’s won praise for working collaboratively with Democratic legislative leaders and for tackling thorny problems such as the opioid addiction crisis and the sputtering MBTA.

It’s not good enough, Gonzalez says.

“I don’t think someone who’s fine, or OK, or getting along well with people should be the measure,” he said of Baker. “It should be: What are we doing? What are we accomplishing? What are we even trying to accomplish?”

Gonzalez contends that Baker has failed to show leadership on “big challenges” facing the state – making housing, child care and college more affordable, for example, or shoring up deteriorating infrastructure.

“To be fair to Gov. Baker, he didn’t sell himself as ‘I’m going to be a leader on these issues,’ ” the Democrat added. “He said, ‘I’m going to come in and try to manage a few things better.’ I don’t think we should settle.”

Jim Conroy, a political adviser to Baker, said the governor has no timetable for making decisions or announcements about 2018.

Gonzalez enters the race with a background strikingly similar to the man he hopes to unseat.

Baker worked in the administrations of Republican Govs. William Weld and Paul Cellucci in the 1990s and served as secretary of administration and finance, the state’s top budget official. He later headed Harvard Pilgrim Health Care, leading a financial turnaround for one of the state’s largest insurers.

Gonzalez served as secretary of administration and finance in Patrick’s administration and later became chief executive of CeltiCare Health, an insurance plan geared toward lower-income residents.

Gonzalez faults Baker’s handling of state finances, saying he’s underfunded key state programs and failed to replenish the state’s so-called “rainy day” fund.

Unlike the Republican incumbent, Gonzalez is open to tax increases. He supports a constitutional amendment that would impose a 4 percent surtax on millionaires.

“I’ll be honest, we need more revenue,” he said. “Right now we are spending more than we can afford based on the revenue we have.”

Tim Vercelotti, director of the polling institute at Western New England University, said Baker has taken stances that are difficult for Democrats to push back on, including his opposition to Trump on health care, immigration and other policies.

“And yet there is an energy in the Democratic Party in Massachusetts right now that is different than previous cycles,” Vercelotti added, noting unusually high turnout at recent Democratic caucuses around the state, almost certainly driven by concerns over Trump. A more motivated Democratic base could hurt Baker, he said, even if the Republican is on the same page with them on many issues.

“I don’t think Baker is in trouble by any metric, but the race has gotten more interesting,” he said.