SLOVYANSK, Ukraine—Ukrainian authorities are scrambling to evacuate the remaining civilians from the eastern Donetsk and Luhansk regions as Russia begins its new military offensive here and pitched battles get closer to the area’s main population centers.

The biggest cities in the Ukrainian-controlled parts of Donetsk and Luhansk, such as Kramatorsk, Slovyansk and Severodonetsk, have already turned into ghost towns, with almost all stores and businesses closed, streets emptied and only a handful of apartments in each housing block still inhabited.

As the massing Russian forces attempt to push through Ukrainian defenses under the cover of long-range artillery and aircraft, Ukrainian officials have warned that any civilians staying behind could be trapped—as happened in February in the city of Mariupol, where Kyiv says more than 10,000 people have died in weeks of bloody urban fighting. Some 100,000 people still remain in Mariupol as Ukrainian defenders hold out in a pocket of the port city.

President Biden told reporters Tuesday that the U.S. planned to send more artillery to Ukraine, and the Pentagon has been asking allies over the past week to provide ammunition, a U.S. defense official said, amid worries that Ukraine’s fighters could reach dangerously low levels of ammunition within weeks.

On Monday, two Russian battalion tactical groups with some 60 tanks broke through Ukrainian lines after a three-day battle and took the town of Kreminna in the Luhansk region, Ukrainian officials said. From Kreminna, Russian forces overnight pushed through forested areas in the direction of Slovyansk, taking two villages. Heavy shelling raged on front lines in Donbas on Tuesday.

Ukrainian troops stand watch in Krashnohorivka, Ukraine.

Slovyansk entrepreneur Yuriy Mikish transfers supplies to a military vehicle.

“There is no more time for thinking. Leave! Thousands of residents of Kreminna didn’t get out in time and have now become hostages of the Russians,” Serhiy Haidai, governor of the Luhansk region, said. “Save your lives so as not to become cheap labor for the Russians or not to be mobilized into occupation forces.”

Russian President Vladimir Putin in February recognized the so-called Donetsk and Luhansk people’s republics, the pro-Russian statelets created in 2014. The new borders of those statelets include two-thirds of the Donetsk and Luhansk regions that Kyiv controlled at the time. Mr. Putin proclaimed the “liberation” of Donbas, as this area is collectively known, as the war’s key goal and doubled down on that objective after an initial push to seize Kyiv failed.

The Donetsk and Luhansk “republics” have rounded up and drafted men up to the age of 65, sending them with little training and World War II-vintage weapons to the front lines against Ukrainian forces. That is one reason why civilian men, in particular, should leave the areas targeted by the Russian offensive as soon as possible, Ukrainian officials say. The evacuation isn’t mandatory, however. “It is an evacuation, not a deportation,” Mr. Haidai said.

On Tuesday, columns of Ukrainian reinforcements were heading toward Donbas from central Ukraine, with troops, ammunition and artillery pieces on the roads. In the front-line town of Maryinka, on the western approach to the Russian-controlled city of Donetsk, thumps of artillery continued through the morning. Ukrainian forces were digging trenches and tank obstacles in the rear, preparing layers of additional defensive lines.

In Maryinka itself, the central area was deserted, with charred buildings, shredded trees and scattered shrapnel and mortar tail fins after weeks of relentless Russian pounding. As with elsewhere along the front line, hours of shelling preceded probes by Russian infantry and forays by Russian tanks.

While the U.S. and allies have supplied Ukrainian forces with thousands of modern antitank missiles, there aren’t enough to cover all segments of the front, Ukrainian troops say—a reason why Russian tank units have been able to breach their lines in recent days.

Ukrainian troops are firing thousands of rounds a day, and almost all their artillery pieces use Soviet-standard ammunition that isn’t compatible with U.S.-made guns. Because of that, the U.S. is reaching out to nations with stocks of compatible ammunition, including Poland, France, the Czech Republic and Canada, the U.S. defense official said.

In a videoconference Tuesday, Mr. Biden and other world leaders discussed providing more ammunition and security assistance to Ukraine, White House press secretary Jen Psaki said. She said the U.S. is also continuing to discuss additional sanctions on Russia.

In Slovyansk, men in uniform have already begun to outnumber civilians on once-busy streets, with many of the troops stocking up on dwindling supplies in the few remaining supermarkets before heading back to the front.

Slovyansk holds high symbolic importance for both sides. The Donbas conflict began here in 2014, when Russian military veterans led by a former intelligence service colonel seized the local administration with the support of pro-Russian locals. A Ukrainian military offensive retook Slovyansk and nearby Kramatorsk weeks later, but failed to seize the region’s main cities, Donetsk and Luhansk.

Russian troops now are pushing from several directions. The biggest effort is coming from the direction of the town of Izyum, north of Slovyansk, using as many as 50 battalion tactical groups, said Pavlo Kyrylenko, head of the civil-military administration of the Donetsk region.

“We have no choice but to fight and to hold on to our territory. If there will be no fierce resistance, and if we don’t achieve a victory here, Putin will not stop at us and will keep going further, toward Kyiv and onward to threaten the countries of the European Union,” Mr. Kyrylenko said.

Police Capt. Ihor Trebach, head of criminal investigations in the Kramatorsk district, which includes Kramatorsk and Slovyansk, said his officers were going house to house this week, trying to convince residents that it was time to go.

“What we have seen so far is whenever the Ukrainian Armed Forces are successful in the battlefield and push back the Russian forces, the Russians retaliate by simply shelling the civilian cities nearby. This has become the pattern throughout this war,” he said.

A member of the Ukrainian border guard scanning the road into Maryinka with binoculars on Tuesday.

Parts of central Slovyansk have been deserted.

His officers’ pleas got a mixed reaction, Capt. Trebach said. Some residents, exposed to Russian propaganda on social media, still don’t believe that Russian forces would shell civilians and attribute the destruction of cities such as Mariupol to alleged neo-Nazis, he said. Others are afraid that their apartments will be looted if they evacuate. Many more, however, realize the danger but don’t want to abandon relatives who can’t or won’t leave their hometowns.

Even in villages under constant shelling, such as Maryinka, some civilians remain in their homes. On Tuesday, a grocery was still open on a road lined with blooming orchards and brightly painted homes—some of them with caved-in roofs from artillery damage—a few blocks away from the devastated center.

“At this point, anyone who is still here is just waiting for the Russian world to come. They think of the Russians as their own,” said Zhenya, a Ukrainian officer in Maryinka. The Wall Street Journal agreed to use only first names for this soldier and some civilians. Some locals, he said, are passing coordinates of Ukrainian positions to Russian forces via messaging apps.

In Slovyansk and Kramatorsk, many of those who want to remain say they are committed to the Ukrainian cause. Others don’t want to leave behind sick loved ones.

Margarita, a 27-year-old resident of Kramatorsk, said her mother, 56, was bedridden after a stroke and her brother was serving locally with the Ukrainian military. “If there were a way to go with my mom, we would. We understand everything,” she said. “For now, we have prepared a cellar. It’s deep and strong. Let’s hope we can survive in it.”

“Only the fools aren’t afraid,” added Olga, a teacher in Slovyansk who was also remaining behind to stay with a sick relative.

While Kramatorsk and Slovyansk, some 20 to 30 miles from the front lines, so far haven’t been shelled with artillery and multiple-launch rocket systems, they are within range. Russia has already fired several cruise missiles at the area, including one that hit a crowd of civilians awaiting an evacuation train at the Kramatorsk train station, killing 57 people, earlier this month. The train station is now closed and evacuations are conducted by bus or car.

A building was devastated by a Russian missile attack in Kramatorsk.

A Ukrainian man in the hole created by the impact of a Russian missile in Kramatorsk.

Another cruise missile hit an empty field off Kramatorsk’s Heroes of Ukraine street on Monday morning, leaving a large crater and shattering windows across several city blocks. Valentina, an 82-year-old resident of the neighborhood, said she still didn’t want to leave even though she no longer had windows in her apartment. “It will all be all right in the end—and where can we go anyway?” she said. After the death of her son last year, she is taking care of her 15-year-old grandson. “Who wants us?” she said as she surveyed the damage. “And how can we afford to go?”

Yuriy Mikish, a Slovyansk entrepreneur who runs a volunteer network helping Ukrainian troops and civilians willing to evacuate, said that there is room and board in western Ukraine or Europe for anyone leaving Donbas these days. “All they have to do now is to say yes,” he said. “And we have people who will take care of it.”

Nearly five million people have left Ukraine since Russia’s invasion on Feb. 24, according to the United Nations. Many more were internally displaced.

One of those leaving Slovyansk on Tuesday for the western Ukrainian city of Rivne was a bakery worker named Lida. “We had kept hoping this would bypass it, that somehow we would manage to stay on,” she said. “Now, it’s clear it’s time to go.”

Her partner Denis, who walked her through Slovyansk’s empty main square, said he also realized the urgency to escape but didn’t want to abandon his 13-year-old daughter from a previous marriage. “Her mother still hopes things will turn out well and doesn’t want to leave town or give her to me,” he shook his head. “I am trying to convince her and call her every day, but so far without result.”

A Ukrainian woman waits for her turn during the distribution of food in Slovyansk.

Write to Yaroslav Trofimov at yaroslav.trofimov@wsj.com