First, know whether you can buy, and how you will pay
Before anything
Ownership is open to foreigners. The real work is your tax position, proof of funds, and, if you need one, a mortgage a Portuguese bank can actually read: foreign income puzzles lenders until it is documented properly.