When it is said
Anyone can pray it on the day they move into a new home.
It also fits any day when a long grief has lifted, because it thanks God for turning mourning into dancing.
Where it comes from
Author by tradition
A song for dedicating a house
The Hebrew and the Greek Septuagint give it the same heading, a song at the dedication of the house. The Septuagint and the Latin Vulgate number it Psalm 29, because they count the psalms a little differently.
The Hebrew text on Mechon Mamre; The Septuagint in Brenton’s English (1844), Psalm 29; Wikipedia, Psalm 30
Two houses at once
St Athanasius wrote a letter on the Psalms to a man named Marcellinus. For the day you dedicate your house, he gives this psalm and Psalm 127 to pray in thanks. He means two houses at once, the soul that receives the Lord and the home you live in.
The Scripture in it
I will exalt You, O LORD, for You have lifted me up and have not allowed my foes to rejoice over me. O LORD my God, I cried to You for help, and You healed me. O LORD, You pulled me up from Sheol; You spared me from descending into the Pit. Sing to the LORD, O you His saints, and praise His holy name. For His anger is fleeting, but His favor lasts a lifetime. Weeping may stay the night, but joy comes in the morning. In prosperity I said, “I will never be shaken.” O LORD, You favored me; You made my mountain stand strong. When You hid Your face, I was dismayed. To You, O LORD, I called, and I begged my Lord for mercy: “What gain is there in my bloodshed, in my descent to the Pit? Will the dust praise You? Will it proclaim Your faithfulness? Hear me, O LORD, and have mercy; O LORD, be my helper.” You turned my mourning into dancing; You peeled off my sackcloth and clothed me with joy, that my heart may sing Your praises and not be silent. O LORD my God, I will give thanks forever.
Bible text: Berean Standard Bible, public domain.