Yes, and pesto belongs near the top of any list of freezer friendly foods, as long as air never reaches the surface. Basil goes black from oxygen, not from cold. A thin cap of olive oil poured over the top before you seal it is the one move that keeps a batch green.
Basil turns black for the same reason a cut apple does

Bruise a basil leaf and the enzymes inside it start reacting with oxygen, producing the dark pigments you see creeping across a cut stem within minutes. A food processor bruises every leaf at once, which is why homemade pesto begins darkening on the counter before it ever reaches a jar.
Cold slows that reaction down a great deal but does not shut it off, so a container with an inch of air above the pesto will keep browning quietly for months. Remove the oxygen and the reaction simply stops, which is the whole logic behind every technique below.
If you want an insurance policy, blanch the basil first. Dunk the leaves in boiling water for a few seconds, plunge them straight into ice water, squeeze them dry, and then blend. It knocks the enzymes out before they can do anything, and the color stays vivid. The cost is a slightly softer, less peppery basil flavor, which is a fair trade for a batch you plan to keep a long time.
A thin layer of oil on top is the whole trick
Whatever container you use, the last step is the same. Smooth the surface flat, tap the container on the counter to settle it, then pour just enough olive oil over the top to cover it completely. The oil sits as a seal between the basil and whatever air is left in the container.
Press a piece of plastic film directly onto the surface as a second barrier if you are using a jar, and leave a little headspace above it since pesto expands slightly as it freezes. Do not fill a glass jar to the brim.
Pine nuts are the other thing worth thinking about. Nuts carry a lot of fat, and fat goes stale in cold dry air faster than anything else in the recipe. A tightly sealed container protects the nuts as much as the basil.
Cube trays, jars, or flat bags
- Decide on portion size first. One cube is roughly enough for a single serving of pasta, which makes cube trays the most useful format for most households.
- Spoon the pesto into the tray wells, pressing it down so there are no air pockets underneath.
- Top each well with a few drops of olive oil and freeze the tray until the cubes are firm.
- Pop the cubes out, move them into a freezer bag, flatten it to expel the air, and seal.
- For jars, fill to about an inch below the rim, level the top, add the oil cap, and screw the lid on.
- For flat bags, fill and then roll the bag out on the counter so the pesto lies in a thin even sheet you can snap pieces off.
- Label everything with the date and whether the batch has cheese in it.
Thawing, and the dishes it does the most for
| Use | Straight from frozen? | How |
|---|---|---|
| Pasta | Yes | Drop cubes into the hot drained pasta with a splash of cooking water |
| Soup or minestrone | Yes | Stir a cube in at the end, off the heat |
| Roast chicken or fish | Thaw first | Spread under the skin or over the fillet before roasting |
| Sandwich spread or dressing | Thaw first | Refrigerator overnight, then stir |
| Pizza base instead of tomato | Thaw first | Spread thin, bake as usual |
| Scrambled eggs, potatoes, grain bowls | Yes | Add at the end so it never cooks |
Slow thawing in the refrigerator is best when you need it spreadable. What you should not do is microwave it hard, because heat cooks the basil, dulls the color and splits the oil out into a greasy layer that will not stir back in.
The color is also the most honest guide to age you have. A batch that is still bright green under its oil cap is still good pesto, and six months is a realistic run for a well sealed jar. Once the top layer has gone khaki or brownish, oxygen found a way in, and while it is not harmful it will taste muted and slightly hay like. Scrape the dull layer off, taste what is underneath, and wake a tired batch up with fresh lemon zest, a little more cheese and a splash of new oil.