In this article, a novel approach is proposed for solving the optimal configuration problem of a machining system by reliability analysis. There are many kinds of alternative schemes with different numbers or types of machines to produce the same part, but there is difference in the system's reliability and lifecycle cost. Since the mission time could not describe the reliability loss of repairable equipment precisely, a new approach is proposed for the computation of its reliability to estimate the system lifecycle cost. The reason is that in a machining system, the total time spent on each machine includes cutting time and elapsed time. The elapsed time consists of set-up time, waiting time and forced idle time. The reliability loss of a machine mainly occurs within the cutting time. However, in the existing reliability analysis methods, the reliability loss of repairable equipment is always measured using the total time spent on it. Therefore, in this study, based on the mean time between failures (MTBF), a machine's rate of reliability loss is computed by using its actual machining time rather than the total time. Furthermore, each machine's failure frequencies in a machining system could be obtained by its MTBF. So that, the lifecycle cost of a machining system can be exactly determined. To demonstrate the validity of the proposed approach, a piston machining system is provided as an example.