You do not need a German residence permit, work visa, or address to buy property.
While foreigners can get mortgages, banks often require a larger deposit from non-residents (typically 20% or more ). Estimated Closing Costs buying property in germany
Owning property does not grant you a visa, residency, or any immigration benefits. You do not need a German residence permit,