We obtain several congruence relations modulo 5 and 7 for the number of cubic partitions by using modular forms, which are analogous to the classical congruences of Ramanujan for the number of partitions.