Foreign students must register at their place of residence with the Residents Registration Office (Einwohnermeldeamt), just like German citizens.
When you find an apartment, dorm room or communal apartment in Germany, you must register with the Residents Registration Office within two weeks. This also applies to any move!
Registration requires a passport or identity card, as well as a rental agreement.