As the Finanças offices no longer accept walk-ins to get your NIF “over the counter”, you have to schedule an appointment through their online platform. However, you cannot register on that platform without a NIF … yeah, I know
So their recommended solution is to find a Portuguese citizen that will log in with their credentials and schedule an appointment for YOU. I simply asked my real estate agent to do it for me. The appointments come in 15min slots and they are booked quite far ahead into the future, so you might have to wait for some days or even weeks. Try different districts and see which one has appointments available sooner. The big plus is that any office works for this purpose. I drove for an hour but that way I was able to get an appointment 10 days earlier.
Then the day finally comes and you go to the office with the person who made the appointment for you (I think it’s even okay to go without that person). All you need to provide is an ID and a proof of address from your home country (this applies to EU citizens only). The process is very short and after 10 minutes your have a document with your NIF on it. After a few weeks you will receive your online code (to your home address) which enables you to register on the online platform where you can manage your tax and all that jazz.
There you go, you are one step closer to become a citizen in Portugal.
Good luck and be patient