Molecular adsorbates on metal surfaces exchange energy with substrate phonons and low-lying electron-hole pair excitations. In the limit of weak coupling, electron-hole pair excitations can be seen as exerting frictional forces on adsorbates that enhance energy transfer and facilitate vibrational relaxation or hot-electron mediated chemistry. We have recently reported on the relevance of tensorial properties of electronic friction [Phys. Rev. Lett. 116, 217601 (2016)] in dynamics at surfaces. Here we present the underlying implementation of tensorial electronic friction based on Kohn-Sham Density Functional Theory for condensed phase and cluster systems. Using local atomic-orbital basis sets, we calculate nonadiabatic coupling matrix elements and evaluate the full electronic friction tensor in the classical limit. Our approach is numerically stable and robust as shown by a detailed convergence analysis. We furthermore benchmark the accuracy of our approach by calculation of vibrational relaxation rates and lifetimes for a number of diatomic molecules at metal surfaces. We find friction-induced mode-coupling between neighboring CO adsorbates on Cu(100) in a c(2x2) overlayer to be important to understand experimental findings.