Density functional theory calculations for the adsorption of molecular nitrogen on a ruthenium surface are reported. It is found that the N2 molecule is adsorbed while standing perpendicular to the triangular surface of Ru6. Doping by K atoms favours the adsorption of molecular nitrogen. Calculation of the adsorption energy has also been performed on iron and osmium clusters which shows that ruthenium adsorbs better than iron or osmium. It is found that the potential for atomic nitrogen is deeper and more stable than that of molecular nitrogen and hence atomic nitrogen is important for catalysis.