The psalm begins with a petition: remember, O Lord, in David's favor all the hardships he endured. Verses 2 to 5 recall his vow: he swore to the Lord, the Mighty One of Jacob, that he would not enter his house or go up to his bed, nor give sleep to his eyes, until he found a place for the Lord, a dwelling place for the Mighty One of Jacob.
Verses 6 to 10 recall how the ark was found: we heard of it in Ephrathah, we found it in the fields of Jaar. This refers to the story of the ark after the Philistines returned it. The people propose to go to his dwelling place and worship at his footstool, and pray that the Lord arise to his resting place, he and the ark of his might. They ask that the priests be clothed with righteousness, that the faithful shout for joy, and that God not turn away his anointed for David's sake.
Verses 11 to 18 give God's answer: the Lord swore to David that one of his descendants would sit on his throne, and that his sons would sit there forever if they keep his covenant and testimonies. The Lord has chosen Zion as his dwelling and resting place. He promises to bless its provisions, satisfy its poor with bread, clothe its priests with salvation and make a horn sprout for David. He will clothe his enemies with shame, but on his anointed his crown will shine.