Can You Cook Pesto? Yes, Here's How
| ~6 min read | Pasta Sauces
Sections
Yes, you can cook pesto, but the word "cook" needs unpacking. Classic basil pesto (pesto alla genovese) is a cold, uncooked sauce of crushed basil, pine nuts, garlic, salt, Parmesan or pecorino, and olive oil. You do not simmer it like a tomato sauce. Instead, pesto is "cooked" by the residual heat of the pasta or other food it is tossed with, or it is baked into dishes where it becomes part of a cooked preparation. Understanding which method applies to your recipe is the difference between bright green, fragrant pesto and a bitter, oily paste.
What Pesto Actually Is and Why Heat Matters
Pesto is an emulsion: oil suspended with crushed nuts, cheese and herb solids. Traditional preparation uses a mortar and pestle, which bruises the basil rather than tearing it, and that matters for flavor. Basil contains enzymes that turn brown and bitter when the leaves are cut or crushed and exposed to air and heat. A food processor works and is what most home cooks use, but it generates friction heat and oxidizes the basil faster, so pesto made in a machine darkens sooner.
Heat is the central issue. Prolonged cooking destroys the volatile aromatics that make basil pesto taste like basil, and it can turn the sauce dull olive-brown. That is why pesto is almost never boiled. The exception is when pesto is an ingredient in a baked dish, where the surrounding sauce, cheese or dough protects it and the brief oven time is acceptable.
How to Cook Pesto With Pasta
The standard method is tossing, not simmering. Cook the pasta in well-salted water (roughly 1 tablespoon of salt per 4 quarts of water), and pull it 1 to 2 minutes before the package time so it finishes al dente. Before draining, dip out about 1 cup of the starchy cooking water.
- Put 2 to 3 tablespoons of pesto per serving into a large warm bowl, not a hot pan.
- Add a splash of the reserved pasta water and stir to loosen the pesto into a creamy consistency.
- Drain the pasta and add it to the bowl while still steaming hot.
- Toss vigorously for 30 to 60 seconds. The heat of the pasta warms the sauce and the starch in the water helps it cling.
- Add more pasta water a tablespoon at a time if the sauce looks tight, and finish with extra grated cheese.
Do not return pesto to direct heat on the stove. If the dish has cooled, warm it gently over low heat for no more than a minute, stirring constantly. For a 1-pound box of spaghetti or penne, 1/2 to 2/3 cup of pesto is a reasonable amount; pesto is rich, and more than that turns the dish greasy.
Where Cooking Pesto Works Well
- Baked pasta and lasagna: stir pesto into ricotta or béchamel, or dot it between layers. The oven heat is fine because the pesto is inside the dish.
- Pesto chicken or fish: spread pesto under the skin of chicken or on top of salmon before roasting. Cook poultry to 165°F (74°C) and fish to 145°F (63°C), checked with a thermometer.
- Pesto bread and pizza: use it as a base sauce instead of tomato, then bake as usual.
- Pesto roasted vegetables: toss potatoes or green beans with pesto in the last 10 minutes of roasting.
- Pesto soup: stir a spoonful into minestrone or a bean soup off the heat, right before serving.
Common Problems and How to Fix Them
Bitter pesto usually means over-processed basil, old nuts or garlic that has been crushed too long. Rancid pine nuts are a frequent culprit; taste them before using. Brown pesto comes from oxidation. A brief blanch of the basil leaves (10 to 15 seconds in boiling water, then straight into ice water) sets the color, though it softens the flavor slightly. Oily, separated pesto happens when oil is added too fast in a processor; drizzle it in steadily. Pesto that will not coat pasta just needs pasta water and more tossing.
One common misconception: pesto does not need to be cooked to be safe. The ingredients are raw basil, nuts, garlic, cheese and oil, none of which require cooking. The real safety concerns are elsewhere, covered below.
Storing, Freezing and Reheating
Homemade pesto keeps about 5 to 7 days in the fridge in a sealed jar. Press plastic wrap or a thin layer of olive oil onto the surface to slow browning. Freeze pesto in ice cube trays or small jars for up to 3 months at 0°F (-18°C); thaw in the fridge overnight. Pesto does not freeze solid-rock hard because of the oil, so a spoon often works directly.
Leftover pesto pasta should be refrigerated within 2 hours (1 hour if the room is above 90°F) at 40°F (4°C) or below and eaten within 3 to 4 days. Reheat leftovers to 165°F (74°C). Pasta reheats best in a covered pan with a splash of water over medium-low heat, or in the microwave with a damp paper towel over it. Expect the pesto to darken; the flavor holds up better than the color.
Food Safety Notes for Pesto
Pesto itself is low-risk, but a few rules matter. Never use raw or undercooked eggs in any pesto variation, such as a pesto mayonnaise or a pesto dressing thickened with egg; use pasteurized eggs if a recipe calls for them, especially for anyone pregnant, elderly, immunocompromised or a young child. Do not eat raw flour or raw dough, including pesto-flavored pasta dough before it is cooked. If you make homemade pesto pasta dough with raw egg, cook it fully and never taste the raw dough.
Variations and Alternatives
Pesto is a template, not a single recipe. Pesto alla trapanese uses almonds and tomato; pesto alla calabrese adds roasted red pepper; kale, arugula, spinach, walnut and pumpkin-seed pestos all work. Sunflower seeds are a budget stand-in for pine nuts. If you are avoiding dairy, skip the cheese and add a pinch more salt, though the texture will be thinner. For a nut-free version, use toasted sunflower or pumpkin seeds and check labels for cross-contamination if allergies are a concern. Pesto also works as a sandwich spread, a dressing thinned with lemon juice and more oil, or a topping for eggs and grilled cheese.
Frequently Asked Questions
Can you heat pesto in a pan?
Briefly, yes, but keep the heat low and the time short. Pesto scorches easily because of the cheese and nuts, and high heat dulls the basil flavor. Toss it with hot pasta off the heat instead whenever possible.
Does pesto need to be cooked before eating?
No. Traditional pesto is a raw sauce and is safe to eat as made, as long as you use fresh ingredients and refrigerate leftovers promptly.
Why did my pesto turn brown?
Oxidation from cutting the basil and exposure to air. Blanching the leaves briefly, using a sharp blade, and covering the surface with oil or plastic wrap all slow it down.
Can I cook pesto into a sauce for chicken?
Yes. Spread it on chicken before roasting or pan-searing, or stir it into a cream or tomato sauce at the end of cooking. Cook chicken to 165°F (74°C).
How long does pesto last?
About 5 to 7 days refrigerated in a sealed container, and up to 3 months frozen at 0°F (-18°C).
Can I use pesto in a slow cooker?
Yes, but add it in the last 15 to 30 minutes of cooking. Long, slow heat fades the flavor and darkens the color.