The strong shaking sent people fleeing into open areas in and around Palu, a city of about 400,000 people and the capital of central Sulawesi province.
Officials said the quake damaged several buildings in Palu, including government offices, a university auditorium and hotels.
The National Disaster Management Agency said damage assessments were continuing across affected areas and information on possible casualties was still being gathered.
The initial quake was centred 43km east-southeast of Palu, and the US Geological Survey said it was about 10km deep. Several aftershocks followed, the strongest being 5.2 magnitude.
Indonesia's Meteorology, Climatology, and Geophysical Agency said there was no danger of a tsunami but warned aftershocks could continue.
"The earthquake shaking was extremely strong," Palu resident Muhtar Ahmad said.
"We are still traumatised by the previous earthquake, so we chose to remain outside because we are afraid that aftershocks may continue."
Many Sulawesi residents are haunted by the magnitude 7.5 earthquake that devastated Palu in 2018, setting off a three-metre high tsunami and killing more than 4000 people.
In January 2021, a magnitude 6.2 quake near the city of Mamuju on Sulawesi island left at least 100 people dead, with thousands sleeping outdoors for days out in fear of aftershocks.