Ganoderma boninense (G. boninense) infection reduces the productivity of oil palms and causes a severe threat to the palm oil industry. Early detection of G. boninense is vital since there is no effective treatment to stop the continuing spread of the disease unless ergosterol, a biomarker of G. boninense can be detected. There is yet a non-destructive and in-situ technique explored to detect ergosterol. Capability of NIR to detect few biomarkers such as mycotoxin and zearalenone (ZEN) has been proven to pave the way an effort to explore NIR's sensitivity towards detecting ergosterol, as discussed in this paper. A compact hand-held NIR with a measurement range of 900–1700 nm is utilized by scanning the leaves of three oil palm seedlings inoculated with G. boninense while the other three were non-inoculated from 16-weeks-old to 32-weeks-old. Significant changes of spectral reflectance have been notified occur at the wavelength of ∼1450 nm which reflectance of infected sample is higher 0.2–0.4 than healthy sample which 0.1–0.19. The diminishing of the spectral curve at approximately 1450 nm is strongly suspected to happened due to the loss of water content from the leaves since G. boninense attacks the roots and causes the disruption of water supply to the other part of plant. However, a few overlapped NIRs' spectral data between healthy and infected samples require for further validation which chemometric and machine learning (ML) classification technique are chosen. It is found the spectra of healthy samples are scattered on the negative sides of PC-1 while infected samples tend to be on a positive side with large loading coefficients marked significant discriminatory effect on healthy and infected samples at the wavelength of 1310 and 1452 nm. A PLS regression is used on NIR spectra to implement the prediction of ergosterol concentration which shows good corelation of R = 0.861 between the ergosterol concentration and oil palm NIR spectra. Four different ML algorithms are tested for prediction of G. boninense infection: K-Nearest Neighbour (kNN), Naïve Bayes (NB), Support Vector Machine (SVM) and Decision Tree (DT) are tested which depicted DT algorithm achieves a satisfactory overall performance with high accuracy up to 93.1% and F1-score of 92.6% compared to other algorithms. High accuracy shows the capability of the classification model to correctly predict the G. boninense detection while high F1-score indicates that the classification is able to validate the detection of G. boninense correctly with low misclassification rate. The result represents a significant step in the development of a non-destructive and in-situ detection system which validated by both chemometric and machine learning (ML) classification techniques.