Baking fish has always been one of my weeknight saviors. It’s quick, healthy, and doesn’t require me to stand over the stove stirring and flipping things endlessly. This baked cod with pesto is one of those recipes I go back to whenever I want something flavorful but fuss-free. The pesto adds such a bright, herby punch that you hardly need anything else on the plate. A squeeze of lemon, some rice or potatoes, and dinner is ready.

I remember the first time I made this dish was on a Tuesday night after a long day, and I couldn’t believe how simple it was. That first bite of tender cod with lemony basil pesto convinced me it would have a permanent spot in my meal rotation.
Why You’ll Love This Baked Cod with Pesto
Fish often feels intimidating if you didn’t grow up cooking it, but honestly, it’s easier than chicken most days. Cod is a mild white fish, which means it soaks up the flavors you put on it. Here, the pesto really shines—it’s garlicky, fresh, and a little nutty.
This is the kind of recipe that feels fancy enough for a dinner guest but simple enough for a weeknight. I’ve served it with wine and candles for a friend who came over, and I’ve also served it on a weeknight when I was juggling homework with my kids at the table. Either way, it works beautifully.
Ingredients You’ll Need
For the fish:
-
Cod fillets
-
Avocado oil (or olive oil if that’s what you have)
-
Lemon juice
-
Garlic cloves, smashed
-
Sea salt
-
Black pepper
-
Lemon wedges, for serving
For the pesto:
-
Fresh basil leaves
-
Pine nuts
-
Lemon zest
-
Lemon juice
-
Garlic clove, smashed
-
Salt & black pepper
-
Olive oil
Ingredient notes from my kitchen:
-
I like avocado oil because it has a high smoke point, but olive oil works just fine if that’s what you keep stocked.
-
Pine nuts give classic pesto flavor, but I’ve swapped in cashews or almonds when that’s all I had. The pesto was still fantastic.
-
Fresh lemon juice is key—it keeps the pesto bright and balances the richness of the fish.
Substitutions That Work
You don’t need to be married to cod here. I’ve made this same recipe with halibut, rockfish, and even salmon. If you try it with tilapia or sole, just remember they’re thinner, so they’ll bake faster.
As for the pesto, if you’re not in the mood to make it, a good-quality store-bought pesto will still make the dish sing. And if basil isn’t your thing, swap it out for cilantro pesto or even a dill version—both pair beautifully with fish.

How to Make It Step by Step
-
Preheat your oven to 350°F (180°C).
-
Zest the lemon first (trust me, it’s easier before you juice it). Add the zest to a food processor.
-
Squeeze half the lemon juice into a glass baking dish. Add oil, garlic cloves, salt, and pepper. Whisk it all together.
-
Lay your cod in the dish and turn it over a couple of times so it’s well-coated. Let it rest for 15 minutes—it absorbs flavor beautifully this way.
-
While the fish rests, make the pesto: in a food processor, combine lemon zest, remaining lemon juice, basil, pine nuts, garlic, salt, and pepper. With the motor running, drizzle in olive oil until smooth.
-
Spread about 2 tablespoons of pesto over each cod fillet. Cover the dish with foil and bake for 15–20 minutes, until the fish flakes easily with a fork.
-
Serve with extra pesto and lemon wedges on the side.
Tips I’ve Learned Over Time
-
Don’t overcook the fish. The best way to check is to stick a fork in—if it flakes easily, it’s ready.
-
Cover it while baking. It keeps the fish moist and helps the pesto flavor sink in.
-
Use room-temperature fish if possible. I pull it out of the fridge about 15–20 minutes before baking—it helps it cook evenly.
Make Ahead Tips
If I know I’ve got a busy night ahead, I’ll marinate the fish in the lemon-oil mixture earlier in the day and keep it covered in the fridge. The pesto can also be made a day or two in advance and stored in a jar with a thin layer of olive oil on top to keep it fresh and green.
When it’s dinnertime, all I need to do is spread the pesto and pop the dish into the oven.
What to Serve with Baked Cod
I usually pair this with rice—it soaks up all the lemony juices. Coconut rice makes it feel tropical, while mashed potatoes turn it into more of a comfort-food dinner.
On the lighter side, I sometimes roast a tray of veggies alongside it—zucchini, cherry tomatoes, or asparagus. They all pair beautifully with pesto.
Storing and Reheating
Leftovers keep well in the fridge for 3–4 days in an airtight container.
For reheating, I pop the fish back in the oven at 300°F for about 5–8 minutes. If I’m feeling lazy, I’ll eat it cold flaked over a salad—it’s surprisingly good that way.

FAQs
Can I freeze baked cod with pesto?
I wouldn’t recommend it. The texture of the fish changes once frozen, and pesto tends to lose its freshness. Better to enjoy it within a few days.
What can I use instead of pine nuts in the pesto?
Cashews and almonds work great. I’ve even used walnuts once, and it added a nice earthiness.
How do I know if my fish is fresh?
It shouldn’t smell overly “fishy.” Fresh cod smells like the ocean—clean and slightly salty. If it smells off, it probably is.
Can I make this dairy-free?
Yes! This pesto recipe doesn’t use cheese, but if you want that extra richness, you can add Parmesan or Pecorino.
Oven Baked Cod with Pesto
There’s something special about flaky, tender cod paired with the bright, herby punch of pesto.
Ingredients
For the cod
- 4 fillets of cod (about 6–8 ounces each)
- 2 tablespoons fresh lemon juice (from half a large lemon)
- 3 tablespoons avocado oil
- 2 large garlic cloves, lightly smashed
- ½ teaspoon sea salt
- black pepper, to taste
- extra lemon wedges for serving
For the pesto
- 2 cups fresh basil leaves, packed
- ⅓ cup pine nuts
- zest of one large lemon
- 2 tablespoons lemon juice (from half a lemon)
- ½ garlic clove, smashed
- ½ teaspoon sea salt
- ¼ teaspoon ground black pepper
- ⅓ cup olive oil
Instructions
- Set the oven to preheat at 350°F. Lightly oil a square glass baking dish. In the dish, mix together avocado oil, garlic, lemon juice, salt, and pepper until well combined. Nestle the cod fillets in the mixture, turning them so each side is coated, and let the fish rest for about 15 minutes.
- Meanwhile, make the pesto. In a food processor, combine lemon zest, basil, pine nuts, garlic, lemon juice, salt, and pepper. Pulse until finely chopped. With the machine running, slowly drizzle in olive oil until the pesto is smooth and fragrant.
- Spread a couple of spoonfuls of pesto over each cod fillet. Cover the dish and bake for 15–20 minutes, or until the fish flakes easily when tested with a fork.
- Serve warm with extra pesto spooned on top and fresh lemon wedges on the side. Leftover pesto can be stored in the refrigerator, covered, for up to 3–4 days.
Final Thought
Baked cod with pesto is one of those recipes that feels special but is incredibly simple to pull off. Whether you’re making it for a quick weeknight meal or serving it with a glass of white wine on the weekend, it’s a dish that never disappoints. Over time, it has become one of those meals I cook without needing to glance at a recipe—just instinct and habit.
If you’ve been hesitant about cooking fish at home, this is the recipe that might change your mind. Once you try it, you’ll see how easy (and delicious) baking fish can be.

