The Allan family had Poe baptized in the Episcopal Church in 1812. John Allan alternately spoiled and aggressively disciplined his foster son. The family sailed to Britain in 1815. Poe attended the grammar school in Irvine, Scotland (where John Allan was born) for a short period in 1815, before rejoining the family in London in 1816. There he studied at a boarding school in Chelsea until summer 1817. He was subsequently entered at the Reverend John Bransby’s Manor House School at Stoke Newington, then a suburb four miles (6 km) north of London.
Poe moved back with the Allans to Richmond, Virginia in 1820. In 1824 Poe served as the lieutenant of the Richmond youth honor guard as Richmond celebrated the visit of the Marquis de Lafayette. In March 1825, John Allan's uncle and business benefactor William Galt, said to be one of the wealthiest men in Richmond, died and left Allan several acres of real estate. The inheritance was estimated at $750,000. By summer 1825, Allan celebrated his expansive wealth by purchasing a two-story brick home named Moldavia. Poe may have become engaged to Sarah Elmira Royster before he registered at the one-year-old University of Virginia in February 1826 to study languages. The university, in its infancy, was established on the ideals of its founder, Thomas Jefferson. It had strict rules against gambling, horses, guns, tobacco and alcohol, but these rules were generally ignored. Jefferson had enacted a system of student self-government, allowing students to choose their own studies, make their own arrangements for boarding, and report all wrongdoing to the faculty. The unique system was still in chaos, and there was a high dropout rate. During his time there, Poe lost touch with Royster and also became estranged from his foster father over gambling debts. Poe claimed that Allan had not given him sufficient money to register for classes, purchase texts, and procure and furnish a dormitory. Allan did send additional money and clothes, but Poe's debts increased. Poe gave up on the university after a year, and, not feeling welcome in Richmond, especially when he learned that his sweetheart Royster had married Alexander Shelton, he traveled to Boston in April 1827, sustaining himself with odd jobs as a clerk and newspaper writer. At some point he started using the pseudonym Henri Le Rennet.
Poe was first stationed at Boston's Fort Independence while in the army. Unable to support himself, on May 27, 1827, Poe enlisted in the United States Army as a private. Using the name "Edgar A. Perry," he claimed he was 22 years old even though he was 18. He first served at Fort Independence in Boston Harbor for five dollars a month. That same year, he released his first book, a 40-page collection of poetry, Tamerlane and Other Poems, attributed with the byline "by a Bostonian." Only 50 copies were printed, and the book received virtually no attention. Poe's regiment was posted to Fort Moultrie in Charleston, South Carolina and traveled by ship on the brig Waltham on November 8, 1827. Poe was promoted to "artificer," an enlisted tradesman who prepared shells for artillery, and had his monthly pay doubled. After serving for two years and attaining the rank of Sergeant Major for Artillery (the highest rank a noncommissioned officer can achieve), Poe sought to end his five-year enlistment early. He revealed his real name and his circumstances to his commanding officer, Lieutenant Howard. Howard would only allow Poe to be discharged if he reconciled with John Allan and wrote a letter to Allan, who was unsympathetic. Several months passed and pleas to Allan were ignored; Allan may not have written to Poe even to make him aware of his foster mother's illness. Frances Allan died on February 28, 1829, and Poe visited the day after her burial. Perhaps softened by his wife's death, John Allan agreed to support Poe's attempt to be discharged in order to receive an appointment to the United States Military Academy at West Point.