President Biden might seem to be on cruise control until the heat of the 2024 general election. Nearly all of the nation’s top Democrats have lined up behind him, and the Republican nomination fight seems set to revolve around Donald J. Trump’s legal problems.

But he is nevertheless facing his own version of a primary: a campaign to shore up support among skeptical Democratic voters.

As much as the president wants to turn to his looming fight against a Republican — he has signaled he is itching for a rematch with Mr. Trump — his Democratic allies warn he has significant work to do with voters in his own party. He still has to find ways to promote his accomplishments, assuage voters wary of his age and dismiss the Democratic challengers he does have without any drama.

Those upstart rivals include Robert F. Kennedy Jr., the anti-vaccine activist with a celebrated Democratic lineage who has emerged with unexpected strength in early polls even as he spreads conspiracy theories and consorts with right-wing figures and billionaire donors. Mr. Kennedy’s support from Democrats, as high as 20 percent in some surveys, serves as a bracing reminder of left-leaning voters’ healthy appetite for a Biden alternative, and as a glaring symbol of the president’s weaknesses.

“It’s clear there is a softness that perhaps is born out of a worry about electability in 2024,” said Julián Castro, the former housing secretary who ran for president against Mr. Biden in 2020. “While he’s accomplished a lot, there have been areas where I think people feel like he hasn’t quite delivered what was promised on voting rights, immigration reform, police reform and some aspect of climate.”

The White House is taking steps to strengthen Mr. Biden’s political hand, planning a summer of events promoting his legislative achievements. This week, he is making his first overnight campaign trip since announcing his re-election bid, a fund-raising swing through Northern California. Last week, he accepted endorsements from the country’s biggest environmental and labor organizations, which his campaign says will help him coalesce Democratic support.

This month, his campaign began running online advertisements highlighting his record. The Biden team even paid for a billboard truck to circle the Capitol and park in front of the Republican National Committee headquarters.

Yet some of Mr. Biden’s allies say they worry that the president’s still-nascent campaign does not fully grasp the depth of its problems with Democratic voters, who have consistently told pollsters they would prefer that Mr. Biden not seek re-election. Voters remain uneasy about inflation and his stewardship of the economy.

Some allies have even decided not to wait for the president’s team, kicking off freelance voter outreach campaigns meant to increase his support in key places.

This month, Mayor Paige Cognetti of Scranton, Pa., and three other Pennsylvania mayors hopped in a rented van for a road trip across the state to promote projects funded by the Biden administration because they were concerned voters didn’t know about them.

They met in Harrisburg with Lt. Gov. Austin Davis, a Democrat who won office last year. Mr. Davis said Mr. Biden had done “some tremendous things” but worried that voters were unaware. He recalled campaigning in Black barbershops in Philadelphia and hearing that voters felt the country was better off under Mr. Trump.

“They’ve done a pretty bad job of telling the American people and Pennsylvanians what they have done,” Mr. Davis said.

Mr. Kennedy’s popularity in polls is largely because of his family, which has included three Democratic senators, one president and a host of other high-profile figures. A CNN poll late last month that showed Mr. Kennedy with 20 percent support against Mr. Biden found that the main reason voters liked him was because of the Kennedy name.

Surveys have suggested that large numbers of Democratic voters are willing to tell pollsters they would take anyone over Mr. Biden. A poll from a Baltimore TV station last week found that 41 percent of Maryland Democrats preferred their governor, Wes Moore, over Mr. Biden, even though Mr. Moore is backing the president’s re-election.

Yet if Mr. Kennedy manages to maintain this level of support, he could cause Mr. Biden embarrassment in the primaries.

“Could Bobby Kennedy catch a spark? Maybe,” said Michael Novogratz, a billionaire Democratic donor who supported Mr. Biden in 2020 but has pledged not to back any candidate older than 72. “He’s alienated himself because of some of the anti-vax positions, but he is a bright man, articulate, eloquent, connected, has the Kennedy name and would pull a lot of the Trump voters.”

The place Mr. Kennedy might prove the biggest nuisance is New Hampshire, where the president has alienated core supporters by shuffling the Democratic presidential nominating calendar to put South Carolina’s primary first, ahead of the Granite State.

New Hampshire Democrats worry that Mr. Biden may skip their primary, which is likely to come before the slot allocated to the state by the Democratic National Committee. They also worry that if Mr. Biden does participate, enough independent voters angry with him for trying to elevate South Carolina may cast a protest vote for Mr. Kennedy to deal the president an early but cosmetic primary defeat.

“If people feel hurt or slighted, that goes a long way with people in New Hampshire,” said Lou D’Allesandro, a Democratic state senator and longtime Biden ally who warned that the president’s spurning of his state could lead to a Kennedy victory there.

A lawyer who rose to prominence in the 1990s as an environmental activist in New York, Mr. Kennedy, 69, has received a boost from conservative figures like Elon Musk, the Twitter owner who recently hosted him on a two-hour online audio chat, and David Sacks, a venture capitalist and supporter of Gov. Ron DeSantis of Florida who held a Kennedy fund-raiser last week in California.

Mr. Kennedy has adopted positions that put him opposite virtually all Democratic voters. He has opposed an assault weapons ban, spread pro-Russian talking points about the war in Ukraine and suggested American presidential campaigns are rigged. He has also long trafficked in conspiracy theories about vaccines.

A super PAC supporting Mr. Kennedy has raised at least $5.7 million, according to John Gilmore, its executive director.

The Kennedy campaign is being led by Dennis Kucinich, the former left-wing congressman and Cleveland mayor, who cast Mr. Kennedy’s cornucopia of right-wing views as evidence that he is better positioned to win a general election than Mr. Biden — who won in 2020 with significant support from Trump-skeptical moderate Republicans.

“Mr. Kennedy is the one person who has the qualities that can bring about the unity that most Americans are hungering for,” Mr. Kucinich said. “He speaks a language of conciliation and compassion.”

Besides fund-raising efforts, the Biden campaign has not had much of a public presence since its formal rollout in April. Top officials have spent time in recent days in Wilmington, Del., shopping for office space for a campaign headquarters that is expected to open in July, according to two people familiar with the discussions. The campaign, which has just a few employees on its payroll, is expected to add more staff members once its offices open.

White House officials are planning a summer tour branded “investing in America” in which Mr. Biden, Vice President Kamala Harris, their spouses and cabinet members will travel the country to promote the results of legislation Mr. Biden has signed to fund infrastructure and climate projects across the country.

They believe those trips will generate positive local news coverage that will be the first step — certain to be followed by hundreds of millions of dollars in advertising from the Biden campaign and its allies — toward educating Biden-skeptical Democrats and wayward independent voters that Mr. Biden deserves a second term.

“The more Americans learn about the president’s investing in America agenda, the more they support it,” said Ben LaBolt, the White House communications director. “That’s a huge opportunity for us.”

It’s not unprecedented for an incumbent president to face dissension in his party before being renominated. In late 2010, Gallup found Hillary Clinton with 37 percent support in a hypothetical 2012 primary against President Barack Obama — though that was months before he announced his re-election bid.

The White House, the Democratic National Committee and Mr. Biden’s re-election campaign have all declined to talk about Mr. Kennedy on the record — a coordinated effort to avoid giving him oxygen.

Mr. Biden’s allies, though are less reticent.

“That campaign is a joke,” said Representative Robert Garcia of California, a Democrat whom Mr. Biden named to his campaign’s national advisory board last month. “He’s running in the wrong primary and has zero chance of gaining any sort of support.”

Mr. Garcia added, “His views and worldview are dangerous.”

Still, Mr. Kennedy’s early strength highlights Biden weaknesses Republicans are eager to exploit.

Polling conducted in May for Way to Win, a Democratic-aligned group, found that only 22 percent of Latino voters and 33 percent of Black voters were aware of “any specific thing” Mr. Biden had done in office to improve their lives.

“There’s no single sentence that everybody can repeat that is sticking,” said Tory Gavito, the president of Way to Win. “What’s happening is the G.O.P. is flooding the airwaves with a narrative of economic failure, and it’s starting to resonate.

Rebecca Davis O’Brien contributed reporting.