How to Get a Portuguese Driving License as a Foreigner

Whether you are commuting to work, exploring the country or living somewhere outside the major cities, having a valid driving license can make life much easier.
But if you are a foreign resident, what happens to your existing driving license? Do you need to exchange it for a Portuguese one? And what if you have never had a driving license before?
The answer depends largely on where your current license was issued.
Here is everything you need to know about getting or exchanging a driving license in Portugal as a foreigner.