The quake was at a depth of 10km, the European-Mediterranean Seismological Centre (EMSC) said. There have been no reports of casualties or damages so far.
Wednesday’s earthquake took place after three quakes measuring between 4.7 to 5 hit the Southeast Asian country in the past few days.
Indonesia is hosting some of the most powerful leaders of the world’s biggest economies for the two-day G20 gathering, which ends on Wednesday.
A final communique by the group of leaders stated that Russia, which was represented by its foreign minister Sergey Lavrov, was isolated at the gathering, and “most members” condemn its war in Ukraine.
The statement concluding the two-day annual gathering was carefully worded to skirt round the dispute which saw the Russian minister blasted by world leaders including Britain’s Rishi Sunak.
Indonesia, a nation of over 270 million people, is prone to frequent earthquakes as it falls under the “Pacific Ring of Fire”, where different tectonic plates meet and create frequent seismic activity.
Earlier this month, a 6.1-magnitude earthquake jolted North Sulawesi province in central Indonesia but did not trigger a tsunami.
In October, a powerful 6.4 earthquake in the landlocked Abra province left at least 26 people injured and forced an international airport to shut its flight services temporarily.
A 7-magnitude earthquake in July set off landslides, killing at least five people and injuring dozens in Abra and other northern provinces.