Valledoria was part of the giudicato of Torres, and was later acquired by the Genoese family of Doria. After the Aragonese conquest of Sardinia, the area was struck by plague which highly depopulated it. A demographic rise occurred in the early 19th century, when new settlers coming from Aggius and Tempio Pausania created Codaruina. In 1960 the latter became an autonomous commune with the name of Valledoria. In 1983 the frazione of Santa Maria Coghinas became an independente commune.