Is preserving vegetables in oil safe and how long does it last?

Preserving herbs, garlic, chillies, and roasted vegetables in oil produces intensely flavoured oils and condiments that are some of the most useful products from a productive garden. But oil preserving carries a food safety consideration that is important to understand before you begin: oil alone does not prevent bacterial growth, and garlic or herbs submerged in oil without acid or heat treatment can create conditions where Clostridium botulinum produces toxins.

This risk is easily managed. The safe approaches are: use the oil for short-term refrigerated storage only, add sufficient acid to drop the pH below 4.6, or ensure ingredients are thoroughly dried before submerging. Understanding which approach applies to which product lets you make safe, delicious oil preserves with complete confidence.

Herb-infused oils — safe and simple

Dried herbs in oil are safe for long-term storage at room temperature because the herbs contain no moisture for bacteria to grow in. Strip leaves from stems of dried rosemary, thyme, oregano, or bay and place in a clean bottle, then fill with good-quality olive oil. The oil absorbs the herb flavour over two to three weeks, producing a fragrant oil that keeps for several months at room temperature and for up to a year if refrigerated. Fresh herbs in oil are a different matter — they contain moisture and must be refrigerated and used within one to two weeks.

Garlic and chilli in oil — the critical safety rule

Garlic-infused oil is one of the most popular oil preserves, but raw garlic cloves submerged in oil at room temperature pose a genuine botulism risk. The anaerobic environment of the oil combined with the low-acid, high-moisture content of garlic creates ideal conditions for toxin production. The safe options are: refrigerate immediately and use within one week, add citric acid or lemon juice at a ratio that drops the pH below 4.6, or roast the garlic at 180°C until fully cooked through before submerging in oil. Roasted garlic in oil refrigerated is safe for up to two weeks and is one of the most useful preserves in the kitchen.

The same guidance applies to fresh chillies in oil. Dried chillies — fully dehydrated — are safe in oil at room temperature.

Roasted and dried vegetables in oil

Sun-dried tomatoes in oil are a classic preserve that is safe because the drying process removes most of the moisture. Commercially, sun-dried tomatoes are dried to a strict moisture level before being packed in oil. At home, ensure tomatoes are fully dried — completely leathery with no moist interior — before packing in oil. Add a splash of red wine vinegar to the jar for additional acidity and safety. Refrigerate and use within three to four weeks. Roasted red peppers in oil, similarly, are safe refrigerated for one to two weeks. They are not a room-temperature long-term preserve.

Basil pesto and soft herb oils

Blended herb-in-oil products like pesto and basil oil are better treated as fresh products or frozen rather than preserved at room temperature. Blend fresh basil with olive oil, then freeze in ice cube trays — the frozen cubes drop easily into pasta or soup straight from the freezer. This preserves the bright colour and flavour better than any room-temperature method and avoids any safety concern.

Choosing the oil

Extra-virgin olive oil has the best flavour for herb and garlic preserves. It solidifies in the fridge, which is normal — bring to room temperature before using. For neutral-flavoured applications like preserving chillies or vegetables where you don't want to add olive flavour, a light vegetable or rapeseed oil works well. Always use clean, dry equipment and containers — any water introduced to an oil preserve increases both bacterial risk and the speed of rancidity.

Make every herb and vegetable count

The SelfEcoFarm preserving guide covers oil preserves, fermentation, drying, and all safe methods for every garden crop with clear safety guidance.

Get the preserving guide