Planting tree is considered as act of charity in Islam. The more people take benefit of the tree you have planted, the more reward you will get. It is the same as the wealth you give to help needy people.
In a hadith from Jabir (may Allah blesses him), that the Messenger of Allah (ﷺ) says,
ما من مسلم يَغرس غَرسا إلا كان ما أُكل منه له صدقة، وما سُرق منه له صدقة
“When a Muslim plants a tree, whatever is eaten from it is charity from him and whatever is stolen is charity and whatever is subtracted from it is charity” [Saheeh Muslim].
Also, in a hadith from Anas bin Malik (may Allah blesses him), that the Messenger of Allah says,
مَا مِنْ مُسْلِمٍ يَغْرِسُ غَرْسًا أَوْ يَزْرَعُ زَرْعًا فَيَأْكُلُ مِنْهُ طَيْرٌ أَوْ إِنْسَانٌ أَوْ بَهِيمَةٌ إِلَّا كَانَ لَهُ بِهِ صَدَقَةٌ
“No Muslim plants a tree or sows seeds and then a bird, or a human, or an animal eats from it but that it is charity for him” [Saheeh Bukhari & Muslim].
Noble Shaikh Ibn Baz explains, “All Mu’min (believers) people should have high energy and good will in all kind of good deeds. Cultivation, planting, watering, water, anything that benefits people. With good intention, hoping for the reward of God. Such as planting and farming, finding water factories for people, a flowering place for people, facilitating the road, removing harm from roads, etc.”
Waqf is the way to preserve your wealth. Join our Waqf Program to help us-Sunnah Foundation’s growth at ussunnah.org/waqf