The Messenger of Allah ﷺ used to commend prayer at night during Ramadan, but did not command it as duty. He would say: If anyone prays during the night in Ramadan because of faith and seeking his reward from Allah, his previous sins will be forgiven for him. When the Messenger of Allah ﷺ died, this was the practice, and it continued thus during Abu Bakr's caliphate and early part of 'Umar's. Abu Dawud said: This tradition has been transmitted by 'Uqail, Yunus, and Abu Uwais in like manner. The version of 'Uqail goes: He who fasts during Ramadan and prays during the night.
كَانَ رَسُولُ اللَّهِ ﷺ يُرَغِّبُ فِي قِيَامِ رَمَضَانَ مِنْ غَيْرِ أَنْ يَأْمُرَهُمْ بِعَزِيمَةٍ ثُمَّ يَقُولُ مَنْ قَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ فَتُوُفِّيَ رَسُولُ اللَّهِ ﷺ وَالأَمْرُ عَلَى ذَلِكَ ثُمَّ كَانَ الأَمْرُ عَلَى ذَلِكَ فِي خِلاَفَةِ أَبِي بَكْرٍ ؓ وَصَدْرًا مِنْ خِلاَفَةِ عُمَرَ ؓ