Can. 1037

An unmarried candidate for the permanent diaconate and a candidate for the presbyterate are not to be admitted to the order of diaconate unless they have assumed the obligation of celibacy in the prescribed rite publicly before God and the Church or have made perpetual vows in a religious institute.

Read the whole title TITLE VIOrders 1008–1054