The present invention relates to a system and method of cultivating Cordyceps, specifically, provided herein is a system of cultivating Cordyceps comprising: a Hepialus moth trapping device (100) a Hepialus moth eggs screening device, wherein the device is connected with the Hepialus moth trapping device an ascospores-collecting device a mycelia-preparing device a conidia-preparing device an infection device, wherein the device is connected with the ascospores-collecting device, the mycelia-preparing device and the conidia-preparing device and a feeding device, wherein the device is connected with the Hepialus moth eggs screening device and the infection device. And also provided is a method of using the system to cultivate Cordyceps. The system and method have advantages in less manpower, suitable for industrial-scale production of Cordyceps, harvesting Cordyceps with steady production and high quality.