Foster was born in Lawrenceville, a small town which later became a neighborhood of Pittsburgh, Pennsylvania, and grew up as the youngest of ten children in a relatively well-to-do family. His education included a month at college, but little formal music training. Despite this, he had published several songs before he was twenty years old (his first, "Open Thy Lattice Love," appeared when he was eighteen).
In 1846 he moved to Cincinnati, Ohio and became a bookkeeper with his brother's steamship company. While living in Cincinnati, Foster had his first hit songs, including "Oh! Susanna," which was to serve as the "anthem" of the California gold rush in 1848/9. Foster also achieved popularity with several songs published in his compilation Songs of the Sable Harmonists (1848). In 1849 he published Foster's Ethiopian Melodies, which included the hit song "Nelly Was A Lady," made famous by the Christy Minstrels.
That year he returned to Pennsylvania and formed a contract with the Christy Minstrels, beginning the period in which most of his best-known songs were written: "Jeannie With the Light Brown Hair," "My Old Kentucky Home," "Old Folks at Home" ("Swanee River"), "Old Dog Tray," "Nelly Bly," "Beautiful Dreamer" and "Camptown Races." Foster moved to New York City in 1860.
Many of Foster's songs were in the Minstrel show tradition popular at the time. However rather than simply caricaturing African-Americans, they show an empathy for the sufferings of the slave rare in works for the mainstream white audience of the time. This won Foster praise from Frederick Douglass, among others. It is also worth noting that, although his songs largely dealt with life in the South, Foster himself had little firsthand experience there, only having honeymooned in New Orleans in 1852.
Foster tried to make a living as a professional songwriter, and may be considered a pioneer in this respect, since this field of endeavor did not yet exist in the modern sense. Consequently, due in part to the poor provisions for music copyright and composer royalties at the time, Foster saw very little of the profits which his works generated for sheet music printers. Multiple publishers would often print their own competing editions of Foster's tunes, paying Foster nothing. Beginning in 1862 his musical fortunes began to decline, and as they did so did the quality of his new songs, at least in the perception of the contemporary public; this may well have been a result of his teaming with George Cooper, who took over the writing of lyrics for many of Foster's tunes. The wartime economy was also detrimental to his publishing efforts.