In 1862, Miller retired from the bench to become a colonel in the
28th Iowa Infantry Regiment then organised at Camp Pope, near Iowa City. For two months he was engaged in drilling recruits, and in November of that year marched through Missouri to an encampment at
Helena, Arkansas. The regiment engaged in various expeditions, but Miller "contracted a disease which meant death in the South", which forced him to return to Iowa in March 1863. In 1864, Miller began writing law books, beginning with
A Treatise on Pleading and Practice in Actions and Special Proceedings at Law and Equity in the Court of Iowa Under the Revision of 1860. He was appointed to a vacancy on the state supreme court in 1869, and elected to the court the following year, serving for part of his term as chief justice. He taught in the law department of the
University of Iowa from 1871 to 1875, relocating to
Des Moines, Iowa, where he remained until his death. ==Personal life and death==