Zayd bin Thabit reported,

The Messenger of Allah ﷺ set up a small enclosure, which I think he said was made of reed matting, during Ramadan. He prayed inside it for several nights, and a group of his companions joined him in prayer. When he realized they were doing this, he began to remain seated. He then came out to them and said, "I have noticed what you have been doing. People, pray in your homes, for the best prayer a person can offer is the one performed in his home, except for the obligatory prayers."Affan said, Wahib narrated to us, Musa narrated to us, I heard Abu Nadr report from Busr, from Zayd, from the Prophet ﷺ.

Bukhari 731

Sahih

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

عن زيد بن ثابت

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

البخاري 731صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhan
Chapter
Night prayer
Numbering
Darussalam 731
Bukhari 731