A fixed term lease in Germany is only legal in some narrow circumstances and can’t be renewed multiple times in a row. I think after a few years the landlord has to offer you an unlimited lease.
You can of course make a contract that allows for automatic raises, but that is also limited (earliest 12 month after the begin of the lease, only a fixed/absolute value and not percentage) and you can no longer raise the price for the other reasons.
There are probably other models, but I don't know much about them.