I think it's a little more complicated than you're expecting to obtain a permanent resident permit in Portugal.
There are two types of residence permit for a foreign citizen authorized to reside in Portugal:
a) Temporary residence permit;
b) Permanent residence permit.
Temporary Residence Permit
In this case, a residence permit is issued to foreign citizens, valid for a period of 1 year from the date of its issuance, renewable for successive periods of two years. The applicant must meet the following cumulative conditions as well:
- Physical presence in Portuguese territory;
- Possession of means of subsistence;
- Housing;
- Enrollment in Social Security, where applicable;
- No criminal conviction punishable in Portugal by imprisonment for a term exceeding one year;
- Not being prohibited from re-entering Portugal, after being removed from the country;
- No marks in the Schengen Information System and in the SEF Integrated Information System.
Permanent Residence Permit
The law does not establish a term of validity, but should, however, be renewed every 5 years or whenever changes occur to the identification information recorded.
A permanent residence permit to be presented to the SEF, is contingent upon verification of the following cumulative requirements:
- foreign nationals must have had a temporary residence permit for at least 5 years;
- during this period, they cannot have been sentenced to more than one year in prison;
- they must have means of subsistence and accommodation;
- they must prove to have basic knowledge of the Portuguese language.
A residence permit holder has the right to education and instruction, to work as an employee or independently, professional training, access to health care, and access to the law and courts. Residence permits also ensure equal treatment in matters of social security, tax benefits, union membership, recognition of diplomas, certificates and other professional qualifications, or access to goods and services available to the public, as well as the application of provisions granting special rights.
In addition to the general requirements established in "Temporary Residence Permit" above:
A. Residence Permit to Work as an Employee: Only granted to foreign nationals who have employment contracts and enrolled in Social Security.
B. Residence Permit to Work Independently: Only granted to foreign nationals who meet the following requirements:
- they have formed lawful companies, declared the start of business with the tax administration and Social Security as an individual, or executed a service agreement to work as an independent contractor;
- they are qualified to work as an independent contractor, as applicable;
- they are able to sustain themselves;
- they are registered with Social Security;
C. Residence Permit for Research or other Highly Qualified Activity (that is, research, teach at an institution of higher learning, or other highly qualified activity): Only granted to foreign nationals who meet the following requirements:
- they have been hired to work in an officially recognized research center, especially by means of an employment contract, a service agreement, or a grant for scientific research, or
- they have an employment contract or service agreement compatible with teaching at an institution of higher learning or performing another highly qualified activity;
- they are enrolled in Social Security.
____
SEF (Serviços de Estrangeiros e Fronteiras)
https://www.sef.pt/en/Pages/homepage.aspx