The northern port city of Hamburg has drafted in some 20,000 police to protect against terrorist attacks and street violence.
The northern port city of Hamburg has drafted in some 20,000 police to protect against terrorist attacks and street violence at the July 7-8 Group of 20 meeting.
Merkel told parliament that "we know there will be protests, and that is more than legitimate in a democracy".
"But I hope, for the sake of the citizens of Hamburg and the security forces... that these protests will be peaceful".
About 30 demonstrations have been registered in Hamburg before and during the summit.
Most are expected to be peaceful, but some, with mottos such as "Shut Down G20" and "G20 - Welcome to Hell", are considered likely to escalate.
Some activists have vowed to blockade access to the summit venue and use other methods of "civil disobedience".
Police expect a hard core of 7,000 to 8,000 "leftwing extremists" who may turn violent.
A detainee holding centre has been set up with space for 400 persons, and detention judges will be on hand.
"It will be the biggest operation in the history of Hamburg's police," said the city-state's police spokesman Timo Zell.
Protesters have voiced anger about Hamburg being turned into a police "fortress", including a ban on demonstrations during the summit in most of the city centre and along roads to the airport, an area of 38 square kilometres (15 square miles).