Deuteronomy 17:15 "You may appoint a king upon yourselves"

When the Jewish people occupy and settle Eretz Yisrael, they are commanded to appoint a king to rule the nation.

This king is chosen by HaShem and the Torah guides him regarding how to conduct his kingdom.

He must lead the people in the way of HaShem and be dedicated to fulfilling Torah and Mitzvot.