Ants in the compost bin
Two of our compost bins at Stokes Wood demonstration site are infested by ants. Ants feed on a range of food including aphid honeydew (produced by aphids from plant sap excreting), fungi, seeds, scraps, and insects some of which are found in the compost heap. In addition to providing a source of food, the compost bin provides shelter for ant’s nests.
Ant nests are relatively common when cold composting techniques are being used or during the cool maturation stages of hot composting. Many people worry about having ants in their compost heap or bin but they actually contribute to the composting process by bringing fungi, and other organisms, into their nests as well as introducing minerals e.g. phosphorus and potassium. They also help mix the and aerate waste, eat and shred plant materials increasing the surface area available to microbial action and provide additional nutrients by the from their own faeces.
If the compost is almost finished it the part containing the ant colony can be removed and spread on the garden where the ants will probably disappear with a few days. If there are only a few ants I would normally leave them if they or the nest are taking over the bin probably the simplest way to get rid of them is to douse the nest with cold water. This will have the advantage of increasing the moisture level of the compost as ants are often found in compost which is on the dry side.
It is also suggested that sprinkling coffee grounds or cornmeal onto the nest will discourage them. There is more information at Compost Creatures