The Federal Office for Migration and Refugees (BAMF) offers integration courses. You must take such a course if you obtained your residence permit after 1 January 2005 and speak very little or insufficient German.
Online language courses
There are lots of ways to learn German online. The following courses are offered free of charge:
FH PasS - programme for prospective students entitled to asylum (refugees)
The programme for prospective students entitled to asylum (FH PasS) is designed for refugees who have good prospects of residence in Germany and who are interested in studying at FH Münster - University of Applied Sciences. The aim of the programme is to provide orientation to refugees in Germany; offer the possibility to learn the language; and to integrate them long-term into the world of higher education or work.