No, you do not need to be a resident to buy property in Portugal. Foreigners can purchase property without any special restrictions.