Positive commandment · Mitzvat Aseh #176 of 613
To appoint judges and court officers in each and every Jewish community
למנות שופטים ושוטרים בכל קהל וקהל מישראל
The verse · Devarim 16:18
שֹׁפְטִים וְשֹׁטְרִים תִּתֶּן־לְךָ בְּכׇל־שְׁעָרֶיךָ אֲשֶׁר ה׳ אֱלֹהֶיךָ נֹתֵן לְךָ לִשְׁבָטֶיךָ וְשָׁפְטוּ אֶת־הָעָם מִשְׁפַּט־צֶדֶק
“Judges and officers shalt thou make thee in all thy gates, which the Lord thy God gives thee, throughout thy tribes: and they shall judge the people with righteous judgment.”
The Rambam’s words
To appoint judges and court officers in each and every Jewish community, as [Deuteronomy 16:18] states: "Appoint judges and court officers...."
למנות שופטים ושוטרים בכל קהל וקהל מישראל, שנאמר: "שופטים ושוטרים, תיתן לך" (דברים טז,יח).
Why · Sefer HaChinuch #491
To appoint judges and officers
“The root of the commandment is revealed — that with this thing, we will support our religion, in that the fear of our officials and our judges will be on the face of the masses.”
Who & when
“And this commandment — meaning the great and small Sanhedrins and the court of three — is practiced in the Land of Israel, as ordination is there, but not outside of the Land, since we do not ordain outside of the Land.”
Where in the Mishneh Torah
Hilchot The Sanhedrin and the Penalties within Their Jurisdiction הלכות סנהדרין והעונשין המסורין להם