Living in Spain but creating online company in Estonia/Ireland etc.

Hi folks, I have been living since many years in Spain which is where my official residence is and I pay taxes. I am currently employed but would love to create my own online business. I am looking into the options of opening a company in another country as spanish legislation especially for Entrepreneurs is not very attractive and I would end up having debts due to the high cost instead of earnings (given that most likely the first months I would have little to no income)

Option: I did some research and saw that Estonia, Ireland but also Dubai have very simple procedures to start a company additionally to having lower taxes.

- Does someone have experience with those (or other countries i have not named) and how it works?

- How could I then pay myself from that company? Paying a salary would be a bit complex as I would probably end up again in the autonomo scheme which I want to avoid at all cost.

Appreciate any advice as I am quite lost and overwhelmed with how to actually move forward. THANK YOU!!