Who is allowed to apply for German Staatsbürgerschaft (citizenship)?
In principle, all foreign nationals who have legally resided in Germany for at least 5 years, hold a permanent Aufenthaltstitel (residence title), affirm the free democratic basic order, can support themselves, speak German at least at B1 level, and have passed the Einbürgerungstest (naturalization test).
These are the core requirements under § 10 StAG (Nationality Act). Details and exceptions at Requirements. If your residence permit is still temporary, expiring soon, or you are planning to travel, civitas. also supports you with the timely renewal of your residence permit.