Alfred Beckley was born on May 26, 1802 in Washington, D.C., only child of John James Beckley and Maria (or Mary) Prince. In addition to being the first librarian of the United States Congress, John Beckley was also the mayor of Richmond, Virginia, and a clerk for the United States House of Representatives. John Beckley died in 1807, and the family first moved to Pittsburgh, Pennsylvania, then in 1814 to Frankfort, Kentucky. He was also a physician, Methodist preacher, and philanthropist.
In 1834-1835, after lengthy legal disputes, Beckley received the title to 56,679 acres (22,937 ha) his father had owned in western Virginia. In order to manage his inherited estates, Beckley resigned his officer's commission on October 24, 1836. About 1832, he married Amelia Neville Craig, daughter of Neville B. Craig, editor of the Pittsburgh Gazette. They had six sons and one daughter: John (b. March 26, 1833), Neville Craig (b. December 27, 1834), Henry Martin (b. November 23, 1836), William Gregory (b. July 29, 1839), Isaac Craig (b. March 3, 1841), Alfred Beckley Jr. (b. March 5, 1843), and Emma Jane (b. January 12, 1845). Amelia died seven weeks after Emma's birth. Emma died in 1848 of scarlet fever. Beckley's second wife was Jane B. Rapp, with whom he had three more children: Stuart Heber (b. August 21, 1851), Daniel Webster (b. October 28, 1853), and Maria Elizabeth (b. July 1, 1857). Beckley was also a Methodist preacher.
Alfred Beckley was appointed to the United States Military Academy at West Point, nominated for West Point by William Henry Harrison and President James Monroe; he entered on September 25, 1819, and graduated on July 1, 1823, ninth in a graduating class of 35. This class started with 86 cadets in 1819. He was in the army for 13 years, serving the entire time as an artillery officer in Pennsylvania, Florida, Virginia, and New York. He then settled in Fayette County, West Virginia (now Raleigh County, West Virginia), which was then part of Virginia, finding it a "perfect wilderness". Beckley returned to military service as a Brigadier General in the Virginia Militia from 1849‑61; serving out of loyalty to his state even though he strongly opposed its secession from the Union. In 1861, however, the Virginia Secession Commission would not confirm his nomination by Governor John Letcher for Beckley to lead the 35th Regiment of Virginia Volunteers formed by Letcher in May of that year, and not enough men volunteered, so the 35th Regiment never formed.
While in the Virginia Militia during the American Civil War, he served under General Henry A. Wise as part of the Confederate Army. By summer 1861, Beckley was in charge of the 12th Brigade of Virginia militia against Union troops at Cotton Hill, West Virginia, in the Kanawha Valley. This region was largely pro-Union and his militia was not highly motivated, so Wise condemned Beckley's unit in August 1861. Thus, it only served until October 1861, contributing little to the Confederate cause. Beckley even formally complained about the problems finding sufficient recruits to Robert E. Lee. He officially resigned his commission on February 8, 1862. Returning to Union-occupied Beckley, he surrendered to the Union officer in charge, Rutherford B. Hayes, on March 16–17, 1862. He was then arrested by the Union army on April 3, 1862 and sent first to the Atheneum prison camp near Wheeling, West Virginia, and then to Camp Chase, near Columbus, Ohio, as a prisoner of war. He claimed that he was really pro-Union, but had simply been loyal to Virginia, and had severed all ties with the Confederacy. He was released on June 18, 1862 and arrived back in Raleigh County on June 26, 1862. While he did not participate in the war thereafter, at least five of his six sons, except for John, served in the Confederate army.
Beckley was key in founding the city of Beckley on its original 30 acres (12 ha) plat, which was approved by the Virginia General Assembly on April 8, 1838. For the first 12 years or so the new town grew very slowly. Beckley served in several public service roles, often in overlapping terms: School Commissioner, 1837‑1850; Deputy Clerk of Superior and County Courts, 1838‑1850; first postmaster of city of Beckley, 1839; Commissioner of Forfeited and Delinquent Lands, 1839‑1850; Master Commissioner in Chancery, 1840‑1850 for Fayette County, West Virginia (then part of Virginia); Delegate to the 1844 Whig National Convention, where he voted for Henry Clay for President; Clerk of Circuit Court of Law and Chancery, 1850‑1852, Superintendent of Common Schools, 1850‑1873, for Raleigh County; Director and Superintendent of construction of Giles, Fayette and Kanawha Turnpike, 1840‑1849; State Director, 1851‑1860; President, 1854‑1860, of Logan, Raleigh, and Monroe Turnpike; School Treasurer of Raleigh County; Delegate at Large from West Virginia to the National Democratic Convention at St. Louis, Missouri in 1876, and elected in 1877 as Raleigh County's Representative in the West Virginia House of Delegates. He was also a leader in the state temperance movement and was elected Grand Worthy Patriarch of the Sons of Temperance, which he regarded as the greatest honor he ever received. He also studied medicine and then practiced it for free.
As Beckley came near to the end of his life he sensed he would die on his birthday, and he was correct; he died on May 26, 1888, his 86th birthday. In 1938, a statue of Alfred Beckley was erected in the city of Beckley. A local United States post office is named after him. He is buried at his home's Wildwood Cemetery in Beckley. His home, named Wildwood, was built in 1835-1836, expanded in 1874, and listed on the National Register of Historic Places in 1970. His son John was elected Beckley's first mayor in July 1872. In 1877, Alfred Beckley was West Point's oldest living graduate. In 2009, the city of Beckley began holding and annual Founder's Day celebration in his honor.