Homemade pesto is a vibrant, garlicky sauce made from fresh basil, pine nuts, Parmesan, and olive oil. It’s incredibly versatile, but because it contains fresh herbs, garlic, and cheese, it’s perishable. Knowing exactly how long it lasts in the fridge, freezer, and pantry—and how to store it properly—keeps it safe and flavorful. This guide gives you clear, realistic timelines and tested methods to maximize every batch.
Ingredients
- 2 cups fresh basil leaves, packed (about 2 ounces)
- 1/2 cup extra-virgin olive oil, plus more for covering
- 1/3 cup pine nuts (or walnuts)
- 1/2 cup freshly grated Parmesan cheese
- 2 cloves garlic, peeled
- 1/4 teaspoon salt, or to taste
- Optional: 1 tablespoon lemon juice (helps preserve color)
Instructions
- Place the basil leaves, pine nuts, garlic, and salt in a food processor or blender.
- Pulse several times until the mixture is coarsely chopped.
- With the motor running, slowly drizzle in the olive oil until the pesto is smooth but still has a bit of texture. Stop and scrape down the sides as needed.
- Transfer to a bowl and stir in the grated Parmesan cheese. If using lemon juice, add it now and mix well.
- Taste and adjust salt or garlic if needed.
- Use immediately, or store as described below.
Tips
- Always cover with a thin layer of olive oil before refrigerating or freezing. This prevents oxidation, which causes browning and off-flavors.
- Use a clean, dry spoon every time you scoop out pesto. Introducing water or food particles speeds up spoilage.
- Freeze in small portions, like ice cube trays or tablespoon-sized scoops, so you can thaw only what you need.
- If you’re short on basil, substitute arugula or spinach for up to half the basil—it changes the flavor but still works well.
Serving Suggestions
Toss with hot pasta (use about 1/4 cup per 8 ounces of pasta), spread on sandwiches or wraps, dollop over grilled chicken or fish, stir into scrambled eggs, or use as a pizza base instead of tomato sauce. It also makes a quick marinade for vegetables or shrimp.
Variations
- Nut-free: Replace pine nuts with toasted sunflower seeds or pumpkin seeds.
- Vegan: Omit the Parmesan and add 2 tablespoons nutritional yeast for a cheesy flavor.
- Spicy: Add a pinch of red pepper flakes or a small fresh chili.
- Herb swap: Use cilantro or parsley instead of basil for a different profile.
Storage and Reheating
Refrigerator: Homemade pesto keeps for 3 to 5 days in an airtight container. Always press a piece of plastic wrap directly onto the surface before sealing, or pour a thin layer of olive oil on top. Stir well before using. Discard if you see mold, a slimy texture, or an off smell.
Freezer: Properly frozen pesto lasts up to 3 months (quality is best within 6 weeks). Freeze in ice cube trays, then transfer the cubes to a zip-top bag. Or spoon into small jars, leaving 1/2 inch of headspace. Thaw overnight in the fridge or at room temperature for 30 minutes. Do not refreeze thawed pesto.
Pantry: Unopened, commercially made pesto can sit in a cool, dark pantry until the “best by” date. Homemade pesto should never be left at room temperature for more than 2 hours (1 hour if the room is above 90°F). After that, bacteria can multiply quickly.
Reheating: Pesto is usually used cold or at room temperature. If you want it warm, add it to hot pasta and toss—the residual heat is enough. If you must heat it separately, do so gently in a saucepan over low heat for 1–2 minutes, stirring constantly. Do not boil, as the cheese can separate and the basil can turn bitter.
Frequently Asked Questions
How can I tell if pesto has gone bad?
Signs of spoilage include a sour or fermented smell, a gray or brown color, visible mold (fuzzy spots), or a slimy texture. If any of these appear, discard the entire batch—do not just scrape off the mold.
Can I freeze pesto with cheese in it?
Yes, you can freeze pesto with Parmesan. The texture may change slightly (the cheese can become slightly grainy), but it’s perfectly safe. For the smoothest texture after thawing, you can freeze the basil, nuts, garlic, and oil first, then stir in the cheese after thawing.
Why does my pesto turn brown in the fridge?
Exposure to air causes oxidation, which turns basil dark. Keeping a layer of olive oil on top and pressing plastic wrap against the surface minimizes air contact. Lemon juice also helps slow browning.
How long does pesto last in the fridge if I add extra lemon juice?
Lemon juice can help preserve color and add a bit of acidity, but it does not significantly extend the safe storage time. The 3–5 day rule still applies. Acidic ingredients may slow some spoilage, but they don’t stop bacterial growth.
Can I leave pesto out while serving at a party?
Perishable food should not sit at room temperature for more than 2 hours. If you’re serving pesto as a dip or condiment, place the bowl in a larger bowl of ice water to keep it cold, or offer small portions and replenish as needed.
Is it safe to eat pesto that’s been in the fridge for a week?
It’s risky. The USDA recommends discarding perishable foods after 3–5 days in the fridge. Even if it looks and smells fine, harmful bacteria may be present. When in doubt, throw it out.