To 'run amok', which is sometimes spelled 'run amuck', is to behave in a wild or unruly manner.
'Run amok' is now synonymous with the term 'go crazy', but originally had a specific meaning. The term originated in Southeast Asia, where 'amok' (variously spelled amuk, amuck, amuco) meant 'a murderous frenzy or rage'. This derived from the state of mind of the Amuco - a class of 'death or glory' warriors who were employed in local power struggles in Java and Malaysia. Their belief was that fallen warriors became favourites of the gods, whereas failed missions were punished by dishonour and death. Unsurprisingly, the Amuco warriors had little to lose and their attacks were maniacal and frenzied. This is first alluded to in the 1516 text Barbosa, which was translated by Stanley, in 1866:
"There are some of them [the Javanese] who go out into the streets, and kill as many persons as they meet. These are called Amuco."
Captain James Cook, in his account of his travels in that part of the world - Voyages, 1772, gives an explicit definition of 'run amok':
"To run amock is to get drunk with opium... to sally forth from the house, kill the person or persons supposed to have injured the Amock, and any other person that attempts to impede his passage."
See also - read the riot act.