DC microgrids are gaining more importance in maritime, aerospace, telecom, and isolated power plants for heightened reliability, efficiency, and control. Yet, designing a protective system for DC microgrids is challenging due to novelty and limited literature. Recent interest emphasizes standalone fault detection and classification, especially through data-driven machine-learning approaches. However, the emphasis remains on progressing state-of-the-art tools for fault diagnosis in DC microgrids. Therefore, this work emphasizes fault detection and classification in a low-voltage standalone DC microgrid using a data-driven machine learning hybrid approach: bagged ensemble learner and cosine k-nearest neighbour (C-kNN) algorithms. The proposed fault detection and classification scheme makes the use of local voltage and current measurements which enhances the admissibility of the proposed scheme. The bagged ensemble learner accurately identifies the faults in the line, whereas the cosine k-nearest neighbor classifies the fault as pole to ground or pole to pole for further corrective actions. A diverse set of test scenarios encompassing faulty and normal conditions has been analyzed and validated by randomizing data inputs. The test model comprising PV, battery source, and loads have been constructed in MATLAB/Simulink environment. The proposed scheme promises accurate fault identification and classification in normal and noisy environments. To establish the robustness of the proposed approach, the outcomes of the fault detection and classification scheme have been compared with the methods reported in the literature. The results indicate that the proposed method outperformed in comparison to existing methods.