It is a positive commandment — one of the 613 — to appoint a Jewish king. The king’s appointment was originally dependant on the settlement of Jews in Eretz Yisroel — and it is a commandment that will be reinstated with the upcoming Geulah (Redemption from exile) with the coronation of Melech HaMoshiach, a scion of the [Royal] House of King David, speedily in our days.
However, there are aspects of the commandment that are applicable nowadays too. It states in the liturgy of the prayer for blessing the New Moon, “David, the king of Israel lives and endures”. The Rambam explains that Dovid Hamelech was promised the kingship forever, as stated in the Prophets. From that time onward, it includes all of Jewish history: both when Jews have sovereignty over Eretz Yisroel and a Jewish king rules overtly with all the physical trappings of a monarchy, and even during the times when this position is only present in a hidden manner.
The Head of Exile or Exilarch in Babylonian times was of Beis Dovid, and universally accepted as a stand-in for the king by the expatriate Jews; this designation would equally apply to all Jewish leaders throughout exile who share this special ancestry.
Our prayers every day focus on pleas for the final Redemption when this hidden power will again be restored “as in days of old” not only in a latent way, but manifest for the whole world to see. In Grace after Meals we mention this too—beginning with the plea, “have mercy”, as our true comfort will be the reinstitution of the kingship of beis Dovid.