In my Father’s house there are many rooms; if it were not so, I would have told you. I am going there to prepare a place for you.@John 14:2
Phoebe Cary (1824–1871)

Phoebe Cary, 1852. The song was popularized in the Moody-Sankey evangelistic campaigns in Britain. The Congregational Quarterly for October 1874 says, It was written, she tells us, in the little back third story bedroom, one Sabbath morning in 1852, on her return from church.

Dulce Domum Robert S. Ambrose, 1876 (🔊 pdf nwc).

A gentleman traveling in China found at Macao a company of gamblers in a back room on the upper floor of a hotel. At the table nearest him was an American, about twenty years old, playing with an old man. While the gray-haired man was shuffling the cards, the young man, in a careless way, sang a verse of One sweetly solemn thought, to a very pathetic tune. Several gamblers looked up in surprise on hearing the singing. The old man, who was dealing the cards, gazed steadfastly at his partner in the game, and then threw the pack of cards under the table.

Where did you learn that song? he asked. The young man pretended that he did not know what he been singing. Well, no matter, said the old man, I have played my last game, and that’s the end of it. The cards may lie there till doomsday, and I’ll never pick them up. Having won a hundred dollars from the young man, he took the money from his pocket and, handing it over to the latter, said, Here, Harry, is your money; take it and do good with it; I shall with mine.

The traveler followed them downstairs, and at the door heard the old man still talking about the song which the young man had sung. Long afterward a gentleman in Boston [Massachusetts] received a letter from the old man, in which he declared that he had become a hard working Christian and that his young friend also had renounced gambling and kindred vices.

Sankey, p. 211

One sweetly solemn thought
Comes to me o’er and o’er;
Nearer to my home today am I
Than e’er I’ve been before.

Nearer my Father’s house,
Where many mansions be;
Nearer today, the great white throne,
Nearer the crystal sea.

Nearer the bound of life
Where burdens are laid down;
Nearer to leave the heavy cross,
Nearer to gain the crown.

But lying darkly between,
Winding down through the night,
Is the deep and unknown stream
To be crossed ere we reach the light.

Closer and closer my steps
Come to the dread abysm,
Closer death to my lips
Presses the awful chrism.

Feel as I would my feet,
Are slipping over the brink;
For it may be, I’m nearer home—
Nearer now than I think.

Father, perfect my trust!
Strengthen my power of faith!
Nor let me stand, at last, alone
Upon the shore of death.

Be Thee near when my feet
Are slipping over the brink;
For it may be I’m nearer home,
Nearer now than I think.