Yes, you can compost cucumbers.
As they’ve got a high water content, cucumbers compost down incredibly quickly – they won’t add a huge amount of bulk to your compost heap but that moisture will help other things compost down quicker so it’s all good.
Cucumbers are a “green” – if you’ve got a lot to add, mix them in with some dry browns (like fallen leaves, cardboard or wood shavings) to stop the heap becoming too sludgy.
Don’t compost cucumber that has been doused in an excess amount of salad dressing or the like – the oils or fats in the dressing may attract rats or other animals to your compost heap.
How do I compost a cucumber…should I leave it whole or cut it up?