Yes, the no. 1 criterion is where management is exercised. If management is in the UK, the company's global revenue is taxable in the UK.
Now there could also be a PE in Spain, so then corporate income would be taxable in Spain. And since there's a tax treaty between the UK and Spain, there would be less tax to be paid in the UK, since it would be paid in Spain instead. But a PE usually requires some physical presence, so just having a client there wouldn't be sufficient.
But the rules for what constitutes management and control or a PE are complex and can vary from country to country, so you should talk to a UK tax advisor who has heard about these terms.
You may not be aware of it, but 20 years ago or so, it was extremely popular for people all over Europe to incorporate
UK Ltd. companies to reduce the share capital that would need to be paid (1 GBP vs. thousands of euros). They would own UK Ltd. companies that would pay all their
corporate taxes in their home country due to management and control. They didn't pay a single cent in
UK taxes.
You considering incorporating in Estonia is basically the same thing, just the other way around.
If you want to reduce your UK taxes, you would probably at least need some office space (at least a desk or so) in Estonia and be able to prove that you actually work from there at least a certain number of days per month.
Or you could try to hire a local director or employees, but salaries would have to be realistic.
They may also ask why you incorporated in Estonia and if the only reason is "I wanted to save taxes", they may not accept that. So you better have a good story.
But all of this is very complex and country-specific, so you should talk to a good advisor. I'm just trying to give you a very broad idea of what I've found out over the years. I'm not a lawyer.
Of course you could also just incorporate in Estonia, assume that the company is resident there (as you originally did) and only pay tax in the UK on the money that you pay out.
A lot of people have setups like that, simply out of ignorance. But if they catch you, pleading ignorance probably won't cut it. You'd at least be looking at late fees and fines, possibly even criminal charges for tax fraud.