Sayyiduna Ibn Umar (may Allah be pleased with them both) said: The Noble Prophet (peace and blessings be upon him) said: "If people knew what harm there is in solitude, no rider would ever travel alone at night."
Hadith Referenceسنن دارمي / من كتاب الاستئذان / 2714
Most scholars have considered traveling alone to be disliked (makruh), because it is mentioned in the hadith: "A lone traveler is a devil, and two travelers are also devils, and three are a group (jama‘ah)."
Some scholars have said that if there is no fear on the road, then there is no objection to traveling alone, and the prohibitive ahadith are to be understood as applying when the road is dangerous (Wahidi).
Nowadays, even when traveling by bus, train, or airplane, if the journey is undertaken in the form of a group, there are many benefits which are not found in a state of solitude. Being alone during travel is, in reality, a cause of great hardship. (Raz rahimahullah).