We present a study of Co doping in the wide-bandgap spinel Mg3Si6As8 (P4332) at the level of the density functional theory. It is found that among all considered doping sites in the compound, the substitutional doping at the tetrahedral sites is by far the most stable, and the exchange interactions between substitutional Co ions at the tetrahedral sites yield antiferromagnetic order. The crystal field effect in the splitting of the Co-d orbitals as well as the nature in the magnetic couplings between CoMgtet is revealed, and the optimal doping for the highest Néel temperature is found.