How to stop a door from banging while closing
There are a few things you can do:

Check the hinges and use a level to see that the door is square. A heavy door hung incorrectly can slam heavily. Check this guide at national contractors for how to level a door. Some tips from it: check that the hinges are tight, not too heavily greased, and the same distance from the frame.

Install a closer arm (can be expensive)



(source: keylessaccesslocks.com)

If the door isn't closing too hard, but makes a fair amount of noise, try putting some small felt pads on the inside of the jamb to soften the closure.