DC microgrids have gained significant attention in recent years due to their potential to enhance energy efficiency, integrate renewable energy sources, and improve the resilience of power distribution systems. However, the reliable operation of DC microgrids relies on the early detection and location of faults to ensure an uninterrupted power supply. This paper aims to develop fast and reliable fault detection and location mechanisms for DC microgrids, thereby enhancing operational efficiency, minimizing environmental impact, and contributing to resource conservation and sustainability goals. The fault detection method is based on compressed sensing (CS) and Regression Tree (RT) techniques. Besides, an accurate fault location method using the feature matrix and long short-term memory (LSTM) model combination has been provided. To implement the proposed fault detection and location method, a DC microgrid equipped with photovoltaic (PV) panels, the vehicle-to-grid (V2G) charging station, and a hybrid energy storage system (ESS) are used. The simulation results represent the proposed methods’ superiority over the recent studies. The fault occurrence in the studied DC microgrid is detected in 1 ms, and the proposed fault location method locates the fault with an accuracy of more than 93%. The presented techniques enhance DC microgrid reliability while conserving renewable resources, vital to promoting a greener and more sustainable power grid.