Buy a full case and the price per unit drops automaticallyRequest a sample
AccountCart0
All ContainersBottlesJarsCaps & ClosuresPumps & SprayersTubs & PailsJugsDroppersTinsTubesAccessoriesSeals & LinersCansBags & PouchesVialsLabels & DecorationBuckets & PailsDrumsBoxes & MailersBottling Tools
Industries
Learn

How long does homemade pesto keep, and can I freeze or can it?

Updated

On this page8

Homemade pesto keeps only a few days in the refrigerator, at the National Center for Home Food Preservation limit given in the keeping table, and after that it should be frozen or thrown out [2]. The freezer is the place for anything longer: NCHFP calls it the place for "long term storage" [2]. It cannot be canned at home. Penn State Extension says plainly, "Do not can pesto or any similar product," because the oil coats the basil and garlic and creates "an ideal environment for Clostridium botulinum to grow" [3]. This page covers what goes into pesto, keeping it in the refrigerator, freezing it in portions, why canning is ruled out, and the tree nut it carries.

What goes into pesto, and which parts matter for keeping

NCHFP describes pesto as "an uncooked seasoning mixture that usually includes fresh basil, garlic, pine nuts and oil" [2]. Most versions add a hard grating cheese. Each part plays a role in flavor, and three of them decide how it keeps:

  • Fresh basil and garlic are low-acid plant foods that can carry botulism spores from the soil.
  • Oil covers them and shuts out air, which is what turns a bowl of chopped herbs into a botulism concern. The full story is on garlic, herbs and botulism in oil.
  • Nothing in the jar is acidic enough to help. Pesto has no vinegar to speak of, and a home-prepared basil, parsley and garlic pesto behind an Italian botulism case in 1997 measured pH 5.8, far above the 4.6 line [4].

Cheese and nuts change the flavor and texture, and the nut is an allergen, but neither makes pesto keep longer or shorter in any source found.

No tested source gives proportions for a refrigerator pesto, so this page does not give a recipe. Make it to your own taste; the keeping rules below apply whatever the proportions.

In the refrigerator: a few days, dated

  1. Make only what you will use within the limit. For pesto this book follows NCHFP, the strictest published figure written for pesto itself [2]; the number is in the keeping table.
  2. Refrigerate it as soon as it is made, in a clean covered container.
  3. Mark the date it was made and the last day to use it. Oregon State asks for both dates on any herb-in-oil product [1].
  4. Throw it out on that last day. It will still look and smell fine; that tells you nothing about botulism.

Oregon State's SP 50-701 gives a slightly longer limit for herbs and garlic in oil, pesto included [1]. How the published figures compare, and the cold refrigerator they all assume, is on garlic, herbs and botulism in oil.

In the freezer: portions you can use one at a time

Freezing is how you keep a summer's basil into winter. Microbes do not grow while the pesto is frozen, so the limit becomes flavor and color.

  1. Portion it. Oregon State suggests freezing crushed herbs or vegetables in ice cube trays, then moving the frozen cubes to airtight containers [1]. 2. Or pack it in jars or boxes. NCHFP says to "Package in glass freezer jars or plastic freezer boxes, leaving 1/2-inch headspace" [2].
  2. Label and freeze [2]. Put the date on every container.
  3. Thaw in the refrigerator and use the thawed portion within the same limit you would allow fresh pesto.

Many cooks freeze pesto without the cheese and stir grated cheese in after thawing, on the view that the texture holds up better. That is a quality choice; no source found tested it either way.

NCHFP gives no number of months for frozen pesto [2]; how long homemade sauces keep sets out what is and is not known about frozen keeping times.

Why pesto cannot be canned

No research-based home canning process exists for pesto. Oregon State says no research has been done on safe canning times for it [1], and Penn State lists it among foods that are not safe to can, with freezing as the alternative [3]. Recipes online that water-bath or "oven can" pesto have no tested process behind them. No pressure canning process for pesto has been tested either.

The same goes for adding oil to a tested canning recipe such as tomato sauce; Penn State warns against it [3]. The full list of sauces with and without a tested process is on which sauces can be canned at home.

Pesto without basil, nuts or cheese

Kale, arugula, spinach, parsley and cilantro pestos, and versions made with walnuts, almonds or sunflower seeds, are the same kind of food: fresh leaves and often garlic under oil. They follow the same short refrigerator limit and the same freezer route. Herb sauces with vinegar, such as chimichurri, are covered on chimichurri and other green sauces.

Pine nuts and other allergens

Pine nut is on FDA's list of tree nuts that must be declared, so a pesto label names pine nut by type; walnut, almond and the other tree nuts are named the same way, and a cheese pesto also carries milk. Which sauces carry which allergens is on allergens in sauces, and the declaration rules on declaring allergens on a sauce label.

If you want to sell pesto

Because it cannot be made shelf stable at home, pesto is sold refrigerated or frozen. Whether a state allows refrigerated pesto from a home kitchen, and on what conditions, varies by state. Selling refrigerated sauce from home sets out the routes, and refrigerated sauces and the federal rules covers what refrigeration does and does not change for a product you sell.

References

  1. Oregon State University Extension Service, Carolyn Raab and Margy Woodburn, Herbs and Vegetables in Oil, SP 50-701, revised January 2025. https://extension.oregonstate.edu/catalog/pub/sp-50-701-herbs-vegetables-oil
  2. National Center for Home Food Preservation, Freezing Pesto, from So Easy to Preserve, 6th ed., 2014 (read November 19, 2026). https://nchfp.uga.edu/how/freeze/vegetable/freezing-pesto/
  3. Penn State Extension, Martha Zepp, Foods that are Not Safe to Can, updated August 30, 2023. https://extension.psu.edu/foods-that-are-not-safe-to-can
  4. Health Canada, Mitigating the Health Risk Associated with Clostridium botulinum in Plant and Mushroom Products Stored in Oil, modified April 11, 2019. https://www.canada.ca/en/health-canada/services/food-nutrition/legislation-guidelines/guidance-documents/plant-mushroom-oil-profile/plant-mushroom-oil.html