The giant robot arms and high-tech heaters at one of Europe’s largest ammunition plants have been whirring around the clock since the start of the war in Ukraine to produce more desperately needed 155-millimeter artillery shells. If all goes as planned, the factory’s parent company, Nammo, will be turning out as many as 200,000 of the shells a year by 2028 — up to 20 times its prewar production.

But those won’t be nearly enough — nor will they come soon enough — at a time when Ukraine’s forces say they need an average of 250,000 155-millimeter shells each month to repel Russia’s advance. In fact, the combined output of all 11 of the factories that make the shells in Europe will still fall far short of meeting Ukraine’s desperate needs.

It’s a problem that has reverberated across NATO nations, more than three decades after the end of the Cold War led many to pare military spending to the bone in favor of generous social welfare spending. And now, as even the United States is struggling to meet the demand for weapons systems and other matériel, officials and analysts increasingly question whether Europe will be able to expand production from its shrunken military-industrial sector enough to provide Ukraine the assistance it needs.

The answer, it appears, is no, at least in the short term. The NATO allies hope to meet Ukraine’s immediate needs from stockpiles at home and abroad for now as they race to increase production as best they can should the war drag on for years.

“It’s a war about industrial capacity now, both to help the Ukrainians, but also to rebuild stocks,” Nammo’s chief executive, Morten Brandtzaeg, said from Washington, where he was meeting with officials in Congress and at the Pentagon. “I think we should have understood this way before, and acted way before, but we are where we are.”

Mr. Brandtzaeg said it was “a longer route in Europe” to get countries onboard with rebuilding the industry compared with in the United States, which he called “less protectionist” with “more of a long-term view on the market.”

Last month, the European Union agreed to spend up to $2.14 billion to help deliver one million rounds of 155-millimeter shells to Ukraine within 12 months — a benchmark that the United States, with its more robust stockpiles and streamlined funding systems, has already met, but that Europe will have to strain to achieve.

“It is possible that we might not be able to reach it,” said Gabrielius Landsbergis, the foreign minister of Lithuania, one of the most forceful advocates for helping Ukraine.

That will depend to a great extent on Nammo, one of the continent’s largest manufacturers of the shells.

Headquartered about an hour north of Oslo, Nammo, jointly owned by the Norwegian government and a defense firm that itself is majority owned by Finland, produces and warehouses ammunition in nine European countries and the United States and is looking to expand on both continents. But its executives have frequently found their plans thwarted by many nations’ reluctance to commit to significant increases in military spending.

“There are urgent decisions needed from the nations, to be ready to fund this enormous industrial capacity needed,” Mr. Brandtzaeg said. And that, he emphasized, is “impossible” without long-term contracts.

This is particularly true of 155-millimeter artillery shells, which were among the first things European countries trimmed from their defense budgets after the Cold War; Norway, for example, had not ordered any from Nammo since the early 1990s.

A trove of secret Pentagon documents recently exposed on social media revealed that South Korean officials had “suggested the possibility” of selling 330,000 artillery shells to Poland after facing pressure from Washington, but such a deal, if it went through, would only offer a fraction of the needed firepower.

Norway has stepped up by ordering what industry officials estimated would be as many as 35,000 155-millimeter shells for a total of $408 million.

Nammo officials, who for security and competitive reasons would not reveal the company’s current production of 155-millimeter shells, said it was turning them out before the war in the “low tens of thousands.” Even so, Mr. Brandtzaeg said, it would take at least three years for Nammo just to fulfill Norway’s order — which is still being negotiated and the government has yet to pay for.

Nammo has for years sold steady but modest amounts of ammunition to militaries in northern Europe and the United States. But, like other defense industries, it was woefully short of the resources needed to meet the explosive demand after the war in Ukraine began.

Over the last year, the company has been buying up more of the metals, propellant and other materials to produce more shells. But to build them requires more robots and other manufacturing machines — the first phase of which will be delivered to the Raufoss factory in June, after the plant expands its floor space in May to house them.

Until that happens, the production rate will remain “kind of normal,” said John Arne Borresen, a 30-year veteran of Nammo who oversees an assembly line of 155-millimeter artillery shells in Raufoss.

The company is building a new, larger factory for 155-millimeter production, but that will not be completed until late 2024. But even then, Mr. Borresen said, more workers will be needed to operate the machines, and hiring people with engineering backgrounds or other skills necessary to oversee the high-tech weapons assembly remains a challenge.

Nammo is also facing a more novel challenge to its future production: potentially competing with TikTok for southern Norway’s available energy supply after the popular video-sharing app moves into a nearby data storage facility in late November.

Norway’s government approved TikTok’s application last summer to receive the power supply for the data center, which is expected to create thousands of staff and construction jobs and is billed as among the most environmentally sustainable in its industry. But it has exasperated Mr. Brandtzaeg, who said the allocation of public energy risks “prioritizing cat videos in front of urgently needed defense projects.”

Svein Atle Hagaseth, the chief executive of Green Mountain Data Centers, which is leasing the facility to TikTok, denies that it poses a threat to Nammo, saying the area currently has an energy surplus.

In light of the ammunition shortages, industry executives said, Europe’s defense manufacturers are pooling more resources in hopes of speeding deliveries.

Dominique Guillet, an executive vice president at the French firm Nexter, said his company had expanded its employees’ workday to three shifts from one to try to keep up with the wartime demand.

Nexter also builds 155-millimeter anti-tank and air defense munitions but needs parts and supplies if it wants to double its production — which brought Mr. Guillet to Nammo last week to procure some help from a competitor.

Back when Russia first invaded, “everybody thought it would not be a long war,” Mr. Guillet said. But more than a year later, “things are really challenging” within what he described as the “ecosystem” of Europe’s ammunition industry.

“Everybody knows we are competitors, sometimes, but we are also partners for some parts of the components,” he said.

Mr. Borresen, the Nammo factory worker, sounded impatient last week as he looked over a tray of shiny silver shells waiting to be filled with explosives.

“Now, there is a war, but the capacity for producing stuff like this is for peace,” he said.