Johnston was born in Kentucky and was appointed from that state as a United States Navy Midshipman in 1832. He achieved the rank of Lieutenant in 1843 and had not received further promotion when he resigned from the service in April 1861. Johnston joined the Confederate States Navy in the same month as a First Lieutenant and was promoted to Commander in June 1864. His initial Confederate service was as a lighthouse inspector. He was assigned to the New Orleans Station in 1861 and to the forces on Mobile Bay, Alabama, later in that year.
Johnston commanded the ironclads CSS Baltic in 1861-63 and CSS Tennessee in 1864. He was captured with the latter ship during the Battle of Mobile Bay on August 5, 1864, and held as a prisoner of war until the following October. After he was exchanged, Commander Johnston returned to duty in the Mobile area, remaining there until the end of the U.S. Civil War in May 1865, when he surrendered and was paroled.