Abu Saeed Khudri reported,

The Messenger of Allah ﷺ addressed the people and said, "Allah has given a servant the choice between this world and what is with Him, and that servant chose what is with Allah."Abu Bakr wept, and we were astonished at his weeping over the Messenger of Allah ﷺ reporting about a servant who had been given a choice. But the Messenger of Allah ﷺ himself was the one given the choice, and Abu Bakr was the most knowledgeable among us.The Messenger of Allah ﷺ then said, "Among the people most generous to me in companionship and wealth is Abu Bakr. If I were to take a close friend other than my Lord, I would have taken Abu Bakr. But the brotherhood of Islam and its affection suffice. Let no door remain in the mosque except that it be closed, except the door of Abu Bakr."

Bukhari 3654

Sahih

حدثني عبد الله بن محمد حدثنا أبو عامر حدثنا فليح قال حدثني سالم أبو النضر عن بسر بن سعيد

عن أبي سعيد الخدري رضي الله عنه قال

خطب رسول الله ﷺ الناس وقال إن الله خير عبدا بين الدنيا وبين ما عنده فاختار ذلك العبد ما عند الله قال فبكى أبو بكر فعجبنا لبكائه أن يخبر رسول الله ﷺ عن عبد خير فكان رسول الله ﷺ هو المخير وكان أبو بكر أعلمنا فقال رسول الله ﷺ إن من أمن الناس علي في صحبته وماله أبا بكر ولو كنت متخذا خليلا غير ربي لاتخذت أبا بكر ولكن أخوة الإسلام ومودته لا يبقين في المسجد باب إلا سد إلا باب أبي بكر

البخاري 3654صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the companions of the Prophet ﷺ
Chapter
Prophet's ﷺ saying, "Close the doors except the door of Abu Bakr"
Numbering
Darussalam 3654
Bukhari 3654