If you are not a criminal you are supposed to move freely unless you are an asylum seeker in Germany, where, since 1982, there is the Residenzpflicht. It states that as long as the requirements for asylum are being processed, asylum seekers won't be allowed to move out of the district area where they are living without permission of the immigration office (Ausländerbehörde).