On a Friday afternoon in late April, President Biden brought celebrities and elite social media influencers together for a White House reception. Fran Drescher and David Cross mingled with Ilona Maher, a rugby star, and V from @underthedesknews, at a mixer meant to generate warm feelings and badly needed pro-Biden content.

Jonathan M. Katz, an independent journalist and sharp critic of the administration, was shocked to get an invitation. When he met Mr. Biden, he pointedly asked about military aid to Israel and suggested he was supporting a “genocide.” Mr. Biden answered politely, but then appeared to grow impatient. “I know you’re a typical press guy,” he said. “I trust you as far as I can throw your phone.” Aides then ushered Mr. Katz away.

The episode, which Mr. Katz recorded on video and shared with his roughly 100,000 followers, was one in a series of Mr. Biden’s awkward attempts to manufacture online enthusiasm for his candidacy.

For months, the president’s campaign has watched as its rival, Donald J. Trump, has surfed on his popularity among the very online. Mr. Trump’s supporters produce an endless stream of memes, videos and adoring posts — all essentially free advertising — that reach an increasingly crucial slice of voters.

Mr. Biden and his allies are working furiously to build a comparable online army, trying to persuade, or in some cases pay, people to sing Mr. Biden’s praises to their large followings. They are finding that social media feeds are difficult territory for an 81-year-old president whose policies on Gaza and immigration are unpopular on the left.