When the American Civil War began in 1861, Moonlight raised a company of artillery for the 4th Kansas Infantry, but the regiment never completed organization. The recruits to the company (and another regiment) were reassigned to the 1st Kansas Battery; Moonlight briefly served as its captain. Moonlight later joined the 11th Kansas Infantry as its lieutenant colonel. The regiment became the 11th Kansas Cavalry and Moonlight its colonel. Moonlight briefly commanded the 14th Kansas Cavalry as lieutenant colonel but was later ordered to return to the 11th Kansas Cavalry.