You can use ANY lens as a portrait lens - you could even use a 300mm telephoto if you have room
You need a lens with a reasonably wide aperture, to control depth of field, if you need to, and you really need one longer than 40mm to control distortion, but you could take portrates with a 40mm lens.
A 'nifty fifty' would be good, as would almost any midrange zoom.
The question is, will you use it often?? If you buy a spiffy short telephoto for £alotofmoney, to use as a portrait lens, and not use it much, then you've got an expensive short telephoto, that's not a lot of use.
Look at the advice in the posts above, it's good advice, but try to figure out how often you might use it as a portrait lens. You could end up wasting money.
My favourite portrait lens is an 80 - 200 f2.8 Nikkor. Magic