Jabir bin Abdullah reported,

The Messenger of Allah ﷺ used to pray on his mount in whichever direction it faced, but when he wanted to perform an obligatory prayer, he would dismount and face the qiblah.

Azami 2894

Sahih

عن جابر قال

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

الأعظمي 2894صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Witr prayer
Section
Obligatory prayer is not performed on a mount, unlike voluntary prayer
Numbering
Jami al-Kamil 2894 (2nd edition)
Azami 2894