The poem may have been inspired by James Cook's second voyage of exploration (1772–1775) of the South Seas and the Pacific Ocean; Coleridge's tutor, William Wales, was the astronomer on Cook's flagship and had a strong relationship with Cook. On this second voyage Cook crossed three times into the Antarctic Circle to determine whether the fabled great southern continent existed. Critics have also suggested that the poem may have been inspired by the voyage of Thomas James into the Arctic.
According to William Wordsworth, the poem was inspired while Coleridge, Wordsworth, and Wordsworth's sister Dorothy were on a walking tour through the Quantock Hills in Somerset. The discussion had turned to a book that Wordsworth was reading, A Voyage Round The World by Way of the Great South Sea (1726) by Captain George Shelvocke. In the book, a melancholy sailor, Simon Hatley, shoots a black albatross:
We all observed, that we had not the sight of one fish of any kind, since we were come to the Southward of the streights of le Mair, nor one sea-bird, except a disconsolate black Albatross, who accompanied us for several days ... till Hattley, (my second Captain) observing, in one of his melancholy fits, that this bird was always hovering near us, imagin'd, from his colour, that it might be some ill omen ... He, after some fruitless attempts, at length, shot the Albatross, not doubting we should have a fair wind after it.
As they discussed Shelvocke's book, Wordsworth proffers the following developmental critique to Coleridge, which importantly contains a reference to tutelary spirits: "Suppose you represent him as having killed one of these birds on entering the south sea, and the tutelary spirits of these regions take upon them to avenge the crime." By the time the trio finished their walk, the poem had taken shape.
Bernard Martin argues in The Ancient Mariner and the Authentic Narrative that Coleridge was also influenced by the life of Anglican clergyman John Newton, who had a near-death experience aboard a slave ship.
The poem may also have been inspired by the legends of the Wandering Jew, who was forced to wander the earth until Judgement Day for a terrible crime, found in Charles Maturin's Melmoth the Wanderer, M. G. Lewis' The Monk (a novel Coleridge reviewed) and the legend of the Flying Dutchman.
It is argued that the harbour at Watchet in Somerset was the primary inspiration for the poem, although some time before, John Cruikshank, a local acquaintance of Coleridge's, had related a dream about a skeleton ship manned by spectral sailors. In September 2003, a commemorative statue, by Alan B. Herriot of Penicuik, Scotland, was unveiled at Watchet harbour.