"The earthquake caused people to panic. It was felt between 3-10 seconds in four districts in Aceh and North Sumatra province," Abdul Muhari, a spokesman for the BNPB disaster mitigation agency, said in a statement.
Indonesia experiences frequent seismic and volcanic activity due to its position on the Pacific "Ring of Fire", where tectonic plates collide.
On 21 November, a 5.6-magnitude quake hit the populous West Java province on the main island of Java, killing 602 people.
Most of the victims were killed as buildings collapsed or landslides were triggered.
One of Sumatra island's deadliest quakes occurred on December 26, 2004, setting off an Indian Ocean tsunami that killed more than 230,000 people including victims as far away as Sri Lanka, India and Thailand.
That powerful 9.1-magnitude quake triggered 30-metre (100-foot) waves that hit the shore of Banda Aceh on Sumatra.