Abdullah bin Abbas reported,

The Messenger of Allah ﷺ came out during the illness in which he died with his head wrapped in a cloth, sat on the pulpit, praised Allah and extolled Him, then said, "There is no one among the people who has been more generous to me with himself and his wealth than Abu Bakr bin Abu Quhafa. Were I to take a close friend from among the people, I would have taken Abu Bakr as a close friend, but the bond of Islam is greater. Close every door opening into this mosque except the door of Abu Bakr."

Azami 9834

Sahih

عن ابن عباس قال

خرج رسول الله ﷺ في مرضه الذي مات فيه عاصبا رأسه بخرقة، فقعد على المنبر، فحمد الله وأثنى عليه، ثم قال: إنه ليس من الناس أحد أمن علي في نفسه وماله من أبي بكر بن أبي قحافة، ولو كنت متخذا من الناس خليلا لاتخذت أبا بكر خليلا، ولكن خلة الإسلام أفضل، سدوا عني كل خوخة في هذا المسجد غير خوخة أبي بكر.

الأعظمي 9834صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Virtues of the Companions and reports about them
Chapter
Virtues of Abu Bakr and his reports
Section
If the Prophet ﷺ had taken a close friend, it would have been Abu Bakr
Numbering
Jami al-Kamil 9834 (2nd edition)
Azami 9834