During the first millennium BC, the high Serchio valley was populated by the Liguri-Apuani who based their economy on farming and shepherding. Around the 4th century BC, Etruscans settled in the high Edron valley.
During the High Middle Ages, the Byzantines ruled the Garfagnana before the Longobards made it an important military area. Around the 11th century, Vagli was dominated by the Careggine nobles, who had Ghibelline tendencies; during the long fights between Lucca and Pisa, the town usually allied with the latter.
On March 10, 1371, after many years of intense fighting, Alderigo degli Antelminelli ceded the Garfagnana communities to Lucca. Vagli di Sopra and Roggio appear in this treaty. Vagli di Sotto, a Guelph territory, was ruled by the Camporgiano Guelphs. In 1451, the three hamlets belonging to Vagli di Sotto were given to the d'Este family who ruled the area for many centuries.
In 1750, Duke Francesco III d'Este inaugurated the Strada Vandelli which united Modena and Massa. At the end of 1796, the entire Garfagnana region was to have united as part of the Cispadana Republic and agree to the rule of Napoleon; however, not everyone was in accordance, especially the Castelnovesi, Vaglini and Trassilichesi families who organized a revolt against General Rusca on December 27.
In 1884, Vagli was hit hard by a cholera epidemic. The population in Garfagnana continued to grow, however, and immigration soon reached its highest numbers. During the first decades of the 1900s, with the beginning of the marble excavations, the first emergency and social assistance groups emerged. Vagli represented an avant-garde look at workers' rights and socialism.
In 1925, Vagli underwent one of the worst Nazi punishments in the Garfagnana during which many houses were burned. Immigration began again and in 1953, several of the surrounding towns including Pantane, Piari and Fabbriche di Careggine were submerged to increase the nearby artificial dam and residents forced to evacuate without significant recompense.