Your main problem is, whatever foreign company you open while living in Germany, it'll bite you as you are controlling it from Germany.
If you create a foreign company you will need to have a lot of substance requirement in the foreign country and even then Tax office will challenge you.
In...