He was in the Florida war in 1841, and was on the sloop for its circumnavigation of the world in 1843–1845, taking ashore the first American force to land in China. In the Mexican–American War, he participated in the capture of Alvarado, Veracruz, and Tuxpan. He became master on July 15, 1847, and lieutenant on February 5, 1848. While serving on the frigate , he went with Matthew C. Perry to Japan in 1853, during which Preble surveyed various harbors in the Far East.