Yes, you can compost leeks.
The outer leaves and tops compost relatively quickly but if left whole, the body of the leek can take longer – cut it into small pieces to speed up the process.
Leeks are classed as a “green” in composting terms – if you have a lot of leeks to compost, make sure you add them alongside some “browns” (such as toilet roll tubes, newspaper or sawdust) to keep your heap balanced.