Alamogordo began life in June, 1898, as a railhead for the El Paso & Northwestern Railroad when Charles B. Eddy had tracks extended into this area at the western foot of the Sacramento Mountains. In laying out the plat, Eddy required that the streets be large and wide with several tree-lined canals running through the site. East-west streets were designated numerically while north-south streets were given "theme" names (universities, presidents and states). So what was originally Pennsylvania Avenue would later become US Highway 54 and White Sands Boulevard.

Initially, the main industry in the town was the production of railroad ties for the El Paso & Northwestern. After the 1934 creation of White Sands National Monument, tourism began to play a role in the local economy. But the biggest and most far-reaching factor in Alamogordo's economy was the construction of Holloman Air Force Base, beginning in 1942. After that came the designation and construction of the White Sands Missile Range, an area for the testing of new missiles and guidance systems. It was on property owned by the White Sands Missile Range that the first ever atomic bomb test occurred on July 16, 1945. That was at the Trinity Site, about 60 miles northwest of Alamogordo. Visitors can take a guided tour of the site on the first Saturday in April and the first Saturday in October.

Alamogordo also has a history of being a center for other government agencies. 1938 saw construction of a Federal Building at 1101 New York Avenue that housed the US Post Office until 1961. After that the headquarters of Lincoln National Forest were in the building until that agency moved to new quarters in October, 2008. The plan is now to transfer ownership of the building to the Otero County government so that it can become the new county offices.

Southwest of Alamogordo is the White Sands National Monument. On the northeast side of town is the New Mexico Museum of Space History with the International Space Hall of Fame. A branch of New Mexico State University has been in Alamogordo since 1958. 1903 saw the establishment of the New Mexico School for the Blind and Visually Impaired in Alamogordo.