Deuteronomy 17:18

18 When he takes the throne of his kingdom, he is to write for himself on a scroll a copy of this law, taken from that of the Levitical priests.

Read Deuteronomy 17:18 Using Other Translations

And it shall be, when he sitteth upon the throne of his kingdom, that he shall write him a copy of this law in a book out of that which is before the priests the Levites:
"And when he sits on the throne of his kingdom, he shall write for himself in a book a copy of this law, approved by the Levitical priests.
“When he sits on the throne as king, he must copy for himself this body of instruction on a scroll in the presence of the Levitical priests.