You may be granted a residence permit in accordance with § 16 AufenthG for the execution of studies at a German university. The purpose of the stay includes not only the study, but also preparatory measures such as a language course or a Studienkolleg, internships required during the course, postgraduate studies and a doctorate.
The study must be the main purpose of the stay, that is why evening, weekend or distance studies are not sufficient for the issue of a residence permit.
The granting of the residence permit requires that your livelihood is ensured. For this, it must be proven that you have funds per month which correspond to the maximum subsidy rate according to the Federal Training Assistance Act (BAföG). This rate is set annually and currently amounts to 853 euros. In particular, a statement of commitment by a third party, a blocked account with a blocking note amounting to an annual amount (currently 10,236 euros) or a scholarship may be considered as proof of financing.
You also need sufficient health insurance coverage in Germany. A health insurance cover is assessed as sufficient if it corresponds in terms of the type and scope of benefits to the protection of a statutory health insurance. The following benefits must be covered by your health insurance cover: medical and dental treatment, supplies of medicines, dressings, medical aids, hospital treatment, medical services for rehabilitation and benefits during pregnancy and childbirth.
As a national of a Member State of the European Union, you do not need a residence permit, you be studying in Germany under your right of free movement.