Amir bin Rabia reported,

He reported that he saw the Messenger of Allah ﷺ performing the voluntary night prayer while traveling, seated on the back of his mount, facing whichever direction it happened to turn.

Muslim 1619

Sahih

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

عن عبد الله بن عامر بن ربيعة أخبره أن أباه أخبره

أنه رأى رسول الله ﷺ يصلي السبحة بالليل في السفر على ظهر راحلته حيث توجهت

مسلم 1619صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
Permissibility of praying voluntary prayers on a mount while traveling, whichever direction it faces
Numbering
Darussalam 1619
Muslim 1619