Deuteronomy 16:18 – Judges and officers shalt thou make thee in all thy gates, which the LORD thy God giveth thee, throughout thy tribes: and they shall judge the people with just judgment.
Anarchy and vigilantism are expressly prohibited by God’s Law. There must be judges and officers in the gates of every community. No criminal case can proceed legitimately without the involvement of the duly elected or appointed judiciary. How exactly these men or women are to be appointed is not specified, however the command is addressed to the community as a whole. Presumably a king or governor could appoint whomever he wills. If he does not, however, the community must still ensure the post is occupied.
There is at least one situation in which a course of action that appears on the surface to be vigilante is appropriate. This option should only be exercised in the most rare and extreme cases.
If the community refuses to appoint officers or cannot agree on which men to appoint, then individuals who already legitimately possess some other claim to authority must sometimes appoint themselves.
This is essentially the right of the kinsman redeemer extended to the entire community. There is biblical precedence: Pinchas, who was already a priest, appointed himself an officer of the court when he killed Zimri and Cozbi. Judgment had already been passed and executed on the guilty, but their blood had barely cooled when Zimri blatantly committed the very same crimes. A trial was hardly necessary as all the judges were witnesses to the deed. To stop a plague that was sweeping the camp, Pinchas immediately carried out the sentence already given.
Centuries later, Saul was neglecting his responsibilities in enforcing justice in his own lands and defending the border against the Philistines, so David, who had been anointed by Samuel as Saul’s successor, appointed himself judge.
These exceptions are not blanket authorization to engage in vigilantism or mob justice. In each case, the one who acted was acting to save lives and preserve the nation. Our God is a god of order and authority. He commanded that we create a justice system with a hierarchy of courts and that we obey the rulings of our courts. Every crime must be proved by multiple witnesses and a thorough investigation. All of this means that lynching and rioting are anathema to God’s standards of justice.