LUBMIN, Germany — Past a nudist beach and a sleepy marina, a gigantic mesh of metallic pipes rises from the pine forest behind the tiny village of Lubmin on Germany’s Baltic coast.

If few people have heard of Lubmin, from Berlin to Washington almost everyone seems to know the name of the two gas pipelines arriving here directly from Russia: Nord Stream 1, which carries almost 60 million cubic meters of natural gas per year to keep Europe’s biggest economy humming. And Nord Stream 2, built to increase that flow but abruptly shuttered in the run-up to Russia’s attack on Ukraine.

The pair of pipelines has become a twin symbol of Germany’s dangerous dependence on Russian gas — and the country’s belated and frenzied effort to wean itself off it — with calls growing for the European Union to hit Moscow with tougher sanctions as atrocities come to light in Ukraine.

On Tuesday, the European Commission, the E.U.’s executive branch, proposed banning imports of Russian coal and soon, possibly, its oil. But Russian gas — far more critical to Germany and much of the rest of Europe — was off the table. At least for now.

“We are dependent on them,” said Axel Vogt, the mayor of Lubmin, which has a population of just 2,119, as he stood in the industrial harbor between the two pipelines one recent morning. “None of us imagined Russia ever going to war. Now Russia is one of our main suppliers of gas and that’s not something we can change overnight.”

Credit…Sean Gallup/Getty Images

That dependence on Russia — accounting for more than a quarter of Germany’s total energy use — has meant that Berlin has so far refused to cut off President Vladimir V. Putin, whose war it is effectively subsidizing to the tune of an estimated 200 million euros, or about $220 million, in energy payments every day.

The images of mass graves and murdered civilians in the Ukrainian town of Bucha have horrified Europe and spurred demands for a Russian energy embargo, especially among Germany’s eastern neighbors.

“Buying Russian oil and gas is financing war crimes,” said Gabrielius Landsbergis, the foreign minister of Lithuania, which has stopped all Russian gas imports. “Dear E.U. friends, pull the plug. Don’t be an accomplice.”

Chancellor Olaf Scholz of Germany reacted swiftly to the images from Bucha, condemning the “war crimes committed by the Russian military,” expelling 40 Russian diplomats and promising new and tougher sanctions on Moscow. Germany’s network regulator went so far as to take over the German subsidiary of Gazprom, Russia’s main gas company and owner of Nord Stream.

But government ministers have, for now, ruled out a ban on Russian gas imports. The reasons are clear.

Credit…Daniel Berehulak for The New York Times

One in two German homes is heated with gas, and gas also powers much of Germany’s vaunted export industry. For years, Berlin happily relied on Moscow for more than half of its gas imports, a third of its oil and half of its hard coal imports, ignoring warnings from the United States and other allies about Russia weaponizing its energy supplies.

Quitting that habit will not be easy in the short term without a shock to a German economy that like others in Europe is still recovering from the pandemic.

“Our strategy is to become independent of Russian gas, coal and oil — but not immediately,” said Robert Habeck, Germany’s economy minister and vice chancellor, who has been busy traveling to Qatar and Washington in search of alternative gas contracts.

The government is taking steps to make Germany independent of Russian coal by the summer, and of Russian oil by the end of the year. Already, the share of oil imports from Russia has fallen to 20 percent and Russian coal imports have been halved.

But gas — on which Germany is banking as a bridge toward its goal of a carbon neutral economy by 2045 — is an entirely different matter. Mr. Habeck and others said that becoming independent of the Russian supply would take at least two years.

“We can’t substitute gas in the short term,” Christian Lindner, the finance minister said. “We would harm ourselves more than them.”

It has not helped that Germany committed itself to phasing out nuclear power under former Chancellor Angela Merkel, leaving the country more reliant on Russia than before. The legacy of that decision can be seen in Lubmin, too.

Credit…Lena Mucha for The New York Times

Behind the gleaming pipelines are the outlines of a shuttered nuclear power plant, once the biggest in the Communist East Germany. The same year that Ms. Merkel celebrated the opening of Nord Stream 2, she announced that Germany would be quitting nuclear power. The last three nuclear plants are scheduled to come off the grid this year.

“That was a huge mistake, which in light of what’s happening now is more evident than ever,” said Mr. Vogt, the mayor.

Even before Russia’s attack on Ukraine, plans by Mr. Scholz’ new coalition to simultaneously phase out nuclear power and coal while turning Germany into a carbon-neutral economy looked ambitious.

Now even politicians with the Greens, like Mr. Habeck, are exploring what it would take to keep the last nuclear plants running longer. Some worry that the 2030 deadline for closing the last coal plants might also have to be pushed back.

But the pressure for a swift exit from Russian fossil fuels is growing even within Germany, with some arguing that rooted in its own history of genocide, Germany had a moral obligation that trumped economic considerations.

Credit…Maxim Babenko for The New York Times

“The country that proudly proclaims that Europe will ‘never again’ see the likes of Auschwitz is pumping 200 million euros each day into Putin’s war chest,” the financial newspaper Handelsblatt wrote in an editorial. “All of a sudden the discussion in Germany about whether our economy would grow by 6 percent or just 3 percent in the event of an energy embargo seems petty and insignificant. We resemble a hostage to the Kremlin.”

Russia’s war on Ukraine was a wake-up call for Germany, which for decades had bet that trade and economic interdependence with Moscow would keep the peace in Europe.

But, within days of the invasion, Mr. Scholz vowed to break with the energy policy of Ms. Merkel and her predecessor Gerhard Schröder, who still sits on the board of the Russian oil company Rosneft and chairs the shareholders committee of Nord Stream 2.

Mr. Vogt, the mayor of Lubmin, remembers hosting Ms. Merkel and Mr. Schröder in 2011. They had come to open the gas spigot with Dmitri Medvedev, then Russia’s President. “This gas pipeline will make Europe’s energy supply significantly safer,” Mr. Schröder said at the time.

In February, after Mr. Scholz suspended Nord Stream 2, Mr. Medvedev, now deputy chair of the Russian security council, said on Twitter: “Welcome to a new world, in which Europeans will soon pay 2,000 euros for 1,000 cubic meters gas.”

On her morning walk along the beach and past the pipelines in Lubmin one recent morning, Petra Krüger, a 57-year-old radiologist assistant and mother of two, said she was worried about rising energy costs and was only heating in the afternoons now. She recalled the excitement in the village when the original Nord Stream pipeline was built after years of industrial decline.

“It felt like the community had gained this long-term lifeline,” she recalled.

“We were all fooled,” she added. “We should have never allowed ourselves to become this dependent. It’s scary.”

Credit…Lena Mucha for The New York Times

Rising energy costs not only in Germany but also across Europe have raised questions of who will be hurt more by a Russian energy embargo — Mr. Putin or the West.

Some argue that Germany should cut the gas ties first.

“We should act before Putin does,” said Roderich Kiesewetter, a conservative lawmaker and member on the foreign affairs committee of the German Parliament.

The prospect of Mr. Putin himself closing the gas tap is a scenario that the German government is actively preparing for. Last week, Mr. Habeck activated the first step of a national gas emergency plan that could eventually lead to the rationing of natural gas.

Every day, a crisis team of government representatives, regulators and private industry meets to monitor gas supplies. If they start running low, the government will intervene to begin rationing natural gas supplies. Households and critical public services, including hospitals and emergency services, would be prioritized over industry, according to a planning document.

Not only Nord Stream is controlled by Russia. So is Germany’s — and Western Europe’s — biggest gas storage facility, which was taken over by Gazprom in 2015 along with others. Some of these facilities have been running conspicuously low, say German officials, who spy a strategic move by Moscow.

“We must increase precautionary measures to be prepared for an escalation on the part of Russia,” said Mr. Habeck, the economy minister, urging German consumers and companies to begin making efforts to cut their energy use wherever possible.

Credit…Lena Mucha for The New York Times

“Every kilowatt-hour counts,” he said.

But already there is the concern that Germany will trade one dependency for another.

Long term, the strategy is to accelerate Germany’s move into renewable energies — or “freedom energies,” as the finance minister called them. The government is offering new subsidies for the wind and solar sector. Until 2005, Germany was a leader in solar production. Today, 95 percent of solar cells and 85 percent of solar modules are made in China.

“If Russia and China ganged up on us right now, they could flatten us,” said Gunter Erfurt, chief executive of Meyer Burger, the only European company currently making solar modules with its own solar cells. “We need to bring solar manufacturing back to Europe. Europe needs to diversify and fast.”

“We have a lot of sun and wind up here,” Mr. Vogt said. “Maybe that’s the next chapter.”

Christopher F. Schuetze contributed reporting from Berlin.