The U.S. Geological Survey said the magnitude 5.8 quake was centered 64 kilometers (40 miles) northwest of Central Sulawesi province's Pendolo town, at a depth of 10 kilometers (6.2 miles).
Indonesia's national disaster agency spokesman Agus Wibowo said the earthquake didn't have any potential to cause a tsunami.
Still, many people in the provincial capital of Palu ran to higher ground, haunted by the memory of a devastating 7.5 magnitude earthquake in the city two years ago that set off a tsunami as well as a phenomenon called liquefaction in which wet soil is collapsed by the shaking. More than 4,000 people died.
Authorities asked people to stay away from each other and tried to stop them as they ran. Two residents have tested positive for the virus.
Wibowo said at least two people were injured by falling debris and two houses collapsed in Kulawi village in Sigi district.
Indonesia, a vast archipelago of 260 million people, is frequently struck by earthquakes, volcanic eruptions and tsunamis because of its location on the "Ring of Fire," an arc of volcanoes and fault lines in the Pacific Basin.