He studied at Louisville Law School in 1848, but traveled to California for the gold rush in 1849, where he tried his hand at gold mining. After two years of traveling in Europe, he returned to Illinois in 1851, joined the Republican Party at its formation, ran unsuccessfully for the U.S. Congress in 1858, and was elected to the Illinois Senate in 1860. In 1859 Oglesby married Decatur native Anna White. They had four children; Richard, Elizabeth, Robert, and Olive.