Written with people moving from Turkey in mind. The Portuguese rules still apply more broadly.
NIF: Your First Step in Portugal
The NIF (Número de Identificação Fiscal) is your tax ID. You cannot rent a house, get a SIM card, or open a bank account without it.
If you are outside the EU, you usually need a Fiscal Representative. In Lisbon, you can get it at a "Loja do Cidadão", but some branches are much faster than others (like Marvila).