We designed a tunable diode laser absorption spectroscopy (TDLAS) sensor for the online monitoring of CO2 and H2O concentrations. It comprised a small self-design multi-pass cell, homemade laser drive circuits, and a data acquisition circuit. The optical and electrical parts and the gas circuit were integrated into a portable carrying case (height = 134 mm, length = 388 mm, and width = 290 mm). A TDLAS drive module (size: 90 mm × 45 mm) was designed to realize the function of laser current and temperature control with a temperature control accuracy of ±1.4 mK and a current control accuracy of ±0.5 μA, and signal acquisition and demodulation. The weight and power consumption of the TDLAS system were only 5 kg and 10 W, respectively. Distributed feedback lasers (2004 nm and 1392 nm) were employed to target CO2 and H2O absorption lines, respectively. According to Allan analysis, the detection limits of CO2 and H2O were 0.13 ppm and 3.7 ppm at an average time of 18 s and 35 s, respectively. The system response time was approximately 10 s. Sensor performance was verified by measuring atmospheric CO2 and H2O concentrations for 240 h. Experimental results were compared with those obtained using a commercial instrument LI-7500, which uses non-dispersive infrared technology. Measurements of the developed gas analyzer were in good agreement with those of the commercial instrument, and its accuracy was comparable. Therefore, the TDLAS sensor has strong application prospects in atmospheric CO2 and H2O concentration detection and ecological soil flux monitoring.