Longfellow wrote the poem shortly after completing lectures on German writer Johann Wolfgang von Goethe and was heavily inspired by him. He was also inspired to write it by a heartfelt conversation he had with friend and fellow professor at Harvard University Cornelius Conway Felton; the two had spent an evening "talking of matters, which lie near one's soul:–and how to bear one's self doughtily in Life's battle: and make the best of things". The next day, he wrote "A Psalm of Life". Longfellow was further inspired by the death of his first wife, Mary Storer Potter, and attempted to convince himself to have "a heart for any fate".
The poem was first published in the October 1838 issue of The Knickerbocker, though it was attributed only to "L." Longfellow was promised five dollars for its publication, though he never received payment. This original publication also included a slightly altered quote from Richard Crashaw as an epigram: "Life that shall send / A challenge to its end, / And when it comes, say, 'Welcome, friend.'" "A Psalm of Life" and other early poems by Longfellow, including "The Village Blacksmith" and "The Wreck of the Hesperus", were collected and published as Voices of the Night in 1839. This volume sold for 75 cents and, by 1842, had gone into six editions.
In the summer of 1838, Longfellow wrote "The Light of Stars", a poem which he called "A Second Psalm of Life". His 1839 poem inspired by the death of his wife, "Footsteps of Angels", was similarly referred to as "Voices of the Night: A Third Psalm of Life". Another poem published in Voices of the Night titled "The Reaper and the Flowers" was originally subtitled "A Psalm of Death".
The poem, written in an ABAB pattern, is meant to inspire its readers to live actively, and neither to lament the past nor to take the future for granted. The didactic message is underscored by a vigorous trochaic meter and frequent exclamation. Answering a reader's question about the poem in 1879, Longfellow himself summarized that the poem was "a transcript of my thoughts and feelings at the time I wrote, and of the conviction therein expressed, that Life is something more than an idle dream." Richard Henry Stoddard referred to the theme of the poem as a "lesson of endurance".
Longfellow wrote "A Psalm of Life" at the beginning of a period in which he showed an interest in the Judaic, particularly strong in the 1840s and 1850s. More specifically, Longfellow looked at the American versions or American responses to Jewish stories. Most notable in this strain is the poet's "The Jewish Cemetery at Newport", inspired by the Touro Cemetery in Newport, Rhode Island.
Further, the influence of Goethe was noticeable. In 1854, an English acquaintance suggested "A Psalm of Life" was merely a translation. Longfellow denied this, but admitted he may have had some inspiration from him as he was writing "at the beginning of my life poetical, when a thousand songs were ringing in my ears; and doubtless many echoes and suggestions will be found in them. Let the fact go for what it is worth".
"A Psalm of Life" became a popular and oft-quoted poem, such that Longfellow biographer Charles Calhoun noted it had risen beyond being a poem and into a cultural artifact. Among its many quoted lines are "footprints on the sands of time". In 1850, Longfellow recorded in his journal of his delight upon hearing it quoted by a minister in a sermon, though he was disappointed when no member of the congregation could identify the source. Not long after Longfellow's death, biographer Eric S. Robertson noted, "The 'Psalm of Life,' great poem or not, went straight to the hearts of the people, and found an echoing shout in their midst. From the American pulpits, right and left, preachers talked to the people about it, and it came to be sung as a hymn in churches." The poem was widely translated into a variety of languages, including Sanskrit. Joseph Massel translated the poem, as well as others from Longfellow's later collection Tales of a Wayside Inn, into Hebrew.
Calhoun also notes that "A Psalm of Life" has become one of the most frequently memorized and most ridiculed of English poems, with an ending reflecting "Victorian cheeriness at its worst". Modern critics have dismissed its "sugar-coated pill" promoting a false sense of security. One story has it that a man once approached Longfellow and told him that a worn, hand-written copy of "A Psalm of Life" saved him from suicide. Nevertheless, Longfellow scholar Robert L. Gale referred to "A Psalm of Life" as "the most popular poem ever written in English". Edwin Arlington Robinson, an admirer of Longfellow's, likely was referring to this poem in his "Ballade by the Fire" with his line, "Be up, my soul". Despite Longfellow's dwindling reputation among modern readers and critics, "A Psalm of Life" remains one of the few of his poems still anthologized.