Alma was founded in the spring of 1871 by a group of Union Pacific railroad laborers originally from Cheyenne, Wyoming. Harlan County was created by the Nebraska Legislature on June 3, 1871, and Alma was made the county seat on July 3, 1871. A dispute among the original settlers led to a dissolution of the town, but it was re-organized in 1874.
Alma's status as county seat was challenged by residents of Orleans, but an 1884 Nebraska Supreme Court decision affirmed Alma's status as seat of Harlan County. Alma officially incorporated in July 1881. The town was named after a daughter of one of the early settlers.
On January 13, 1880, the Chicago, Burlington and Quincy Railroad reached Alma, providing a significant boost for local commerce and industry. In 1887, the Kansas City and Omaha Railroad also reached Alma. Telephone service reached Alma in June 1899. Electricity arrived with a steam power plant in 1906 and water service followed in 1907.
In 1935, major flooding of the nearby Republican River provided an impetus to build a dam on the river. The Army Corps of Engineers started construction of the Harlan County Dam on August 1, 1946, and completed work in November 1952. The lake thus created, Harlan County Reservoir, became one of Alma's top recreation destinations.
During World War II, Alma hosted a small number of captured German prisoners of war who were interned at Camp Atlanta in neighboring Phelps County and who were employed for farm work and other tasks in Harlan County.