Sunset and evening star. Alfred Lord Tennyson. [Death and Burial.] In Lord Tennyson's Memoir of his father, vol. ii,, p. 366, he gives this account of the writing of this hymn:—
"'Crossing the Bar,' was written in my father's eighty-first year, on a day in October  when we came from Aldworth to Farringford. Before reaching Farringford he had the moaning of the bay in his mind, and after dinner he showed me this poem written out. I said, 'That is the crown of your life's work.' He answered, 'It came in a moment.' He explained the 'Pilot' as ‘That Divine and Unseen Who is always guiding us.’ ... A few days before my father's death  he said to me, 'Mind you put "Crossing the Bar" at the end of all editions of my poems.' ... My father considered Edmund Lushington's translation into Greek of 'Crossing the Bar' one of the finest translations he had ever read."
This translation into Greek is given in the Memoir. The hymn was first published in Lord Tennyson's Demeter and other Poems, 1889, p. 174.
--John Julian, Dictionary of Hymnology, New Supplement (1907)