"When the Ship Comes In" is a folk music song by Bob Dylan, released on his third album, The Times They Are a-Changin', in 1964.
Joan Baez states in the documentary film No Direction Home that the song was, more or less, inspired by a hotel clerk who refused to allow Dylan a room due to his "unwashed" appearance (he was not famous outside of the folk movement at this time). The song then grew into a sprawling epic allegory about vanquishing the oppressive "powers that be". Another inspiration was the Bertolt Brecht/Kurt Weill song, "Pirate Jenny".
According to biographer Clinton Heylin, "When The Ship Comes In" was written in August 1963 "in a fit of pique, in a hotel room, after his unkempt appearance had led an impertinent hotel clerk to refuse him admission until his companion, Joan Baez, had vouched for his good character". Heylin speculates that "Jenny's Song" from Brecht and Weill's Threepenny Opera was also an inspiration: "As Pirate Jenny dreams of the destruction of all her enemies by a mysterious ship, so Dylan envisages the neophobes being swept aside in 'the hour when the ship comes in'." Dylan's former girlfriend Suze Rotolo recalls that her "interest in Brecht was certainly an influence on him. I was working for the Circle in the Square Theater and he came to listen all the time. He was very affected by the song that Lotte Lenya's known for, 'Pirate Jenny'."
Shortly after Dylan wrote the song, he and Baez performed it together at the March on Washington on August 28, 1963. Dylan later performed the song at Carnegie Hall on October 26, 1963; this performance is recorded on The Bootleg Series Vol. 7: No Direction Home: The Soundtrack (2005).
Dylan performed the song during Live Aid on July 13, 1985, accompanied by Keith Richards and Ron Wood of the Rolling Stones.
'Peter, Paul and Mary Sing Bob Dylan' 
French version, as sung by Dylan's friend Hugues Aufray. French lyrics by Pierre Delanoë. Issued on the LP Aufray Chante Dylan (1965). Société Intercontinentale de Musique