When David became king he made a military fortress as his home.
1 Chronicles 11:
1 Then all Israel gathered before David at Hebron and told him, “We are your own flesh and blood. 2 In the past, even when Saul was king, you were the one who really led the forces of Israel. And the Lord your God told you, ‘You will be the shepherd of my people Israel. You will be the leader of my people Israel.’”
3 So there at Hebron, David made a covenant before the Lord with all the elders of Israel. And they anointed him king of Israel, just as the Lord had promised through Samuel.
4 Then David and all Israel went to Jerusalem (or Jebus, as it used to be called), where the Jebusites, the original inhabitants of the land, were living. 5 The people of Jebus taunted David, saying, “You’ll never get in here!” But David captured the fortress of Zion, which is now called the City of David.
6 David had said to his troops, “Whoever is first to attack the Jebusites will become the commander of my armies!” And Joab, the son of David’s sister Zeruiah, was first to attack, so he became the commander of David’s armies.
7 David made the fortress his home, and that is why it is called the City of David. 8 He extended the city from the supporting terraces to the surrounding area, while Joab rebuilt the rest of Jerusalem. 9 And David became more and more powerful, because the Lord of Heaven’s Armies was with him.