LAMPUNG, Indonesia>> Iksan knows the roads around his hometown on the Indonesian island of Sumatra like the back of his hand. He runs a package sorting center from his garage, a small but essential piece of a sprawling network delivering goods bought on Tokopedia, the country’s biggest homegrown e-commerce company.

His team of three motorcycle riders slog through rice fields and palm oil plantations to bring their neighbors boxes and padded envelopes that were purchased online just days before.

In Indonesia, getting a package from one place to another requires extraordinary logistical planning and often intense physical effort. The nation of 270 million people and 17,000 islands spans a distance as far as Britain to Iran.

Tokopedia spent millions of dollars and more than a decade building a complex web of drivers, warehouses and connections with cargo companies. That was a selling point last year when TikTok, which is owned by Chinese internet giant ByteDance, needed a local partner in Indonesia for its TikTok Shop e-commerce feature. It promptly took a stake in Tokopedia.

“Tokopedia knows the local market so well,” said Dewi Rengganis, an analyst at Frost & Sullivan, a consulting firm. “TikTok needed this knowledge.”

Tokopedia and other companies have developed software to help dispatchers and drivers monitor traffic on tiny side streets in out-of-the-way places and the perpetually clogged highways of the capital, Jakarta, on Java, the central island.

Indonesians spent more than $53 billion online in 2023, almost as much as everyone else in Southeast Asia combined. As in many places, ordering for delivery became part of everyday life in Indonesia during the COVID-19 pandemic. The growing popularity of e-commerce on social media apps like TikTok allowed Indonesian businesses to reach customers far away.

To make it all work, a vast fleet of drivers and warehouse workers run a grueling relay race across the country. Most are young men willing to work long hours for a few dollars a day.

“I could be on the road for 12 hours only to deliver around 20 packages,” said Iksan, who is 27 and, like many Indonesians, goes by one name. He and his team’s vehicles regularly get stuck in the mud between rice paddies.

The e-commerce companies — Tokopedia and Shopee are the biggest — compete with offers of free shipping and ever-faster delivery times. A package’s journey starts in a warehouse. The conglomerate behind Tokopedia, GoTo, has a logistics arm that operates five warehouses on Java, home to about half the country’s population.

The largest facility sits hulking on the outskirts of Jakarta. Hundreds of people pack boxes around the clock. Managers said workers were allowed to take breaks during prayer times. But as the evening call to prayer echoed across the truck bay on a recent Friday, no one stopped unloading. Big screens near the ceiling showed the number of packages each worker needed to pack to keep his or her job.

The top performers can pack more than 1,600 packages in an eight-hour shift. They’re almost all gig workers, not employees. If they don’t hit their targets, managers said, they aren’t asked to come back.

On an average day, they churn out around 20,000 packages, Hermiranti, a manager at the warehouse, said.

But orders spike toward the end of each month, when most people across the country get paid. Staffing at the warehouse can as much as triple, and daily orders jump to 70,000 packages, she said.

The packages leaving the warehouse can take every imaginable form of transportation — truck, boat, motorcycle, even ox cart — to reach their destination.

The roads around the gritty Port of Merak on Java are regularly choked with trucks. Drivers wait to make the slow ferry crossing to Sumatra over seas tossed by the volcanic motion of Krakatau.

On Sumatra and Indonesia’s more remote islands, keeping the customers of sneakers, school supplies and baby clothes bought on TikTok Shop satisfied depends on delivery companies like J&T Express, which calls its drivers “sprinters.” The hours and pay vary widely by location, drivers said.

On a recent morning, Odo, 23, took hits from a candy-scented vape while he strapped a tall pile of packages to the back of his motorcycle. His route through the heart of the port city of Lampung in southern Sumatra usually takes about an hour to make 50 deliveries. Sprinters on the outskirts of the city, who cover territory up into the mountains, can spend seven hours bouncing over potholed roads to deliver as few as four packages.

And when they get to their destination, drivers sometimes get stuck holding the bag. Many Indonesians don’t have bank accounts, and the e-commerce companies allow shoppers to pay for items in cash upon delivery.

Yudha, 24, who runs a cargo delivery center near Lampung, said one customer had denied ever ordering the package he delivered, which was worth almost a whole month’s pay, about $100. “I had to carry it back and request the return myself,” he said.

Danu, 28, a supervisor at another J&T Express branch in Lampung, said his colleagues used to stack the next day’s deliveries on the sidewalk outside their office for easy pickup. One night while they had gone back inside, the entire supply — roughly 3,000 packages — was stolen.

He had to reimburse the company for the goods, Danu said. It cost $500 — more than twice the minimum monthly wage in the area.

Danu has been in the delivery business for seven years and has seen online buying and selling explode in Indonesia. He has spent countless long days picking up and dropping off packages at homes, offices and markets around Lampung.

“That’s why we are called sprinters,” Danu said while he helped the first drivers of the day load packages onto their bikes. “We cover everything.”