Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tirmidhi:2377Mūsá b. ʿAbd al-Raḥman al-Kindī > Zayd b. Ḥubāb > al-Masʿūdī > ʿAmr b. Murrah > Ibrāhīm > ʿAlqamah > ʿAbdullāh

"The Messenger of Allah ﷺ was sleeping upon a mat, then he stood, and the mat had left marks on his side. We said: 'O Messenger of Allah! We said: 'O Messenger of Allah! We could get a bed for you.' He said: 'What do I have to do with the world! I am not in the world but as a rider seeking shade under a tree, then he catches his breath and leaves it.'"  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Ṣaḥīḥ.
الترمذي:٢٣٧٧حَدَّثَنَا مُوسَى بْنُ عَبْدِ الرَّحْمَنِ الْكِنْدِيُّ حَدَّثَنَا زَيْدُ بْنُ حُبَابٍ أَخْبَرَنِي الْمَسْعُودِيُّ حَدَّثَنَا عَمْرُو بْنُ مُرَّةَ عَنْ إِبْرَاهِيمَ عَنْ عَلْقَمَةَ عَنْ عَبْدِ اللَّهِ قَالَ

نَامَ رَسُولُ اللَّهِ ﷺ عَلَى حَصِيرٍ فَقَامَ وَقَدْ أَثَّرَ فِي جَنْبِهِ فَقُلْنَا يَا رَسُولَ اللَّهِ لَوِ اتَّخَذْنَا لَكَ وِطَاءً فَقَالَ مَا لِي وَمَا لِلدُّنْيَا مَا أَنَا فِي الدُّنْيَا إِلاَّ كَرَاكِبٍ اسْتَظَلَّ تَحْتَ شَجَرَةٍ ثُمَّ رَاحَ وَتَرَكَهَا قَالَ وَفِي الْبَابِ عَنْ عُمَرَ وَابْنِ عَبَّاسٍ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ

See similar narrations below:

Collected by Ḥākim, Aḥmad's Zuhd
hakim:7858ʿAlī b. Ḥamshādh al-ʿAdl > Muḥammad b. Ghālib > Mūsá b. Ismāʿīl > Thābit b. Yazīd > Hilāl b. Khabbāb > ʿIkrimah > Ibn ʿAbbās

[Machine] Umar ibn Al-Khattab entered upon the Prophet Muhammad ﷺ while he was sitting on a mat and it had left marks on his side. Umar said, "O Messenger of Allah, if you had taken a softer bedding than this." The Prophet replied, "What do I have to do with this world and what does this world have to do with me? By the One in Whose hand is my soul, my example and the example of this world is like that of a traveler who took a rest under a tree on a hot day, then he left and left it behind."  

الحاكم:٧٨٥٨حَدَّثَنَا عَلِيُّ بْنُ حَمْشَاذَ الْعَدْلُ ثَنَا مُحَمَّدُ بْنُ غَالِبٍ ثَنَا مُوسَى بْنُ إِسْمَاعِيلَ ثَنَا ثَابِتُ بْنُ يَزِيدَ ثَنَا هِلَالُ بْنُ خَبَّابٍ عَنْ عِكْرِمَةَ عَنِ ابْنِ عَبَّاسٍ قَالَ

دَخَلَ عُمَرُ بْنُ الْخَطَّابِ عَلَى النَّبِيِّ ﷺ وَهُوَ عَلَى حَصِيرٍ قَدْ أَثَّرَ فِي جَنْبِهِ فَقَالَ يَا رَسُولَ اللَّهِ لَوِ اتَّخَذْتَ فِرَاشًا أَوْثَرَ مِنْ هَذَا فَقَالَ «مَا لِي وَلِلدُّنْيَا وَمَا لِلدُّنْيَا وَمَا لِي وَالَّذِي نَفْسِي بِيَدِهِ مَا مَثَلِي وَمَثَلُ الدُّنْيَا إِلَّا كَرَاكِبٍ سَارَ فِي يَوْمٍ صَائِفٍ فَاسْتَظَلَّ تَحْتَ شَجَرَةٍ سَاعَةً مِنْ نَهَارٍ ثُمَّ رَاحَ وَتَرَكَهَا»  

هَذَا حَدِيثٌ صَحِيحٌ عَلَى شَرْطِ الْبُخَارِيِّ وَلَمْ يُخَرِّجَاهُ وَشَاهِدُهُ حَدِيثُ عَبْدِ اللَّهِ بْنِ مَسْعُودٍعلى شرط البخاري ومسلم
ahmad-zuhd:64ʿAbdullāh from my father > Yazīd b. Hārūn > al-Masʿūdī > ʿAmr b. Murrah > Ibrāhīm > ʿAlqamah > ʿAbdullāh

[Machine] The Messenger of Allah ﷺ slept on a mat, leaving a mark on his side. We said, "O Messenger of Allah, why don't you grant us permission to spread something softer than it for you?" He replied, "What do I have to do with the world? My example and the example of the world is like a traveler who rested under a tree in the heat of the day and then left it."  

الزهد لأحمد:٦٤حَدَّثَنَا عَبْدُ اللَّهِ حَدَّثَنَا أَبِي حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ أَنْبَأَنَا الْمَسْعُودِيُّ عَنْ عَمْرِو بْنِ مُرَّةَ عَنْ إِبْرَاهِيمَ عَنْ عَلْقَمَةَ عَنْ عَبْدِ اللَّهِ قَالَ

نَامَ رَسُولُ اللَّهِ ﷺ عَلَى حَصِيرٍ أَثَّرَ فِي جَنْبِهِ فَقُلْنَا يَا رَسُولُ اللَّهِ أَلَا آذَنْتَنَا فَنَبْسُطَ تَحْتَكَ أَلْيَنَ مِنْهُ؟ فَقَالَ «مَا لِي وَلِلدُّنْيَا؟ إِنَّمَا مَثَلِي وَمَثَلُ الدُّنْيَا كَرَاكِبٍ سَارَ فِي يَوْمٍ صَائِفٍ فَقَالَ تَحْتَ شَجَرَةٍ ثُمَّ رَاحَ وَتَرَكَهَا»