Fiqh-us-Sunnah Volume 2, Supererogatory Prayer, Fiqh 2.119A.

Section : Prayer on a ship, train or plane.

A salah on a ship, train, plane, and so on, is valid and there is no dislike for such an act as it makes life easier for the one performing it. Ibn ‘Umar says: “I asked the Prophet sallallahu alehi wasallam about salah on a ship and he said: ‘Pray standing upon them unless you fear that you will be drowned [i.e., the boat might capsize].”‘ This is related by ad-Daraqutni and by al-Hakim. The later grades it sahih according to the criteria of al-Bukhari and Muslim.

‘Abdullah ibn Abi ‘Utbah reports: “I accompanied Jabir ibn ‘Abdullah and Abu Sa’id al-Khudri and Abu Hurairah on a boat, and they prayed standing in a congregation, with one of them as their imam, although they could have gone ashore [if they had so desired].” This is related by Sa’id ibn Mansur.