UK probably. But resident requirements for starting companies are somewhat rare these days. Getting a bank account or sorting out your taxes is another story though.
To start a UK company, it is not necessary. To be in line with accounting compliance requirements, you need to be able to issue invoices from a UK company bank account. In order to obtain that, you need management to be based in the UK (i.e. be resident).