wiktionary
ref
From coco + nut.
etymonline
ref
coconut (n.)
1610s, "fruit of the tropical palm tree," from coco + nut. In reference to the dried, shredded flesh of the nut used in cookery and confections, by 1830. Meaning "the head" is slang from 1834. Coconut-oil is attested from 1829.