Bacalhau à Zé do Pipo | Portuguese Salted Cod “Shepherds Pie Casserole”

Bacalhau à Zé do Pipo is from the Porto region of Portugal. It was invented in the 1960’s, and is similar to the American dish Shepard’s Pie. This dish is great for a Sunday night dinner with family, because who doesn’t love mashed potatoes?

 

Bacalhau a Ze de Pipo Salt Cod Casserole

Bacalhau à Zé do Pipo | Portuguese Salted Cod Shepard's Pie

Bacalhau à Zé do Pipo is from the Porto region of Portugal. It was invented in the 1960's, and is similar to the American dish Shepard's Pie. This dish is great for a Sunday night dinner with family, because who doesn't love mashed potatoes?
Prep Time 20 minutes
Cook Time 45 minutes
Course Main Course
Cuisine Portuguese
Servings 8

Ingredients
  

  • 2 cups milk
  • 5 garlic cloves minced
  • 3 bay leaves
  • 2 lbs salt cod soaked for 24-48 hours
  • ¼ cup extra virgin olive oil
  • 2 yellow onions cut into rounds
  • 2 lbs russet potatoes peeled, cut into 1-1½" cubes, 3-4 medium sized potatoes
  • 3 tbsp butter
  • 2 egg yolks
  • ¼ cup parsley chopped
  • 1 can black olives whole, pitted
  • ⅓ cup mayonnaise
  • salt to taste
  • black pepper to taste
  • 1 roasted red bell pepper for garnish

Instructions
 

  • To a large pan, bring the milk to a simmer. To the milk add the garlic and bay leaves. Poach the bacalhau for 7 minutes on each side, or until it is tender enough to flake apart. Remove the bacalhau and set aside.
  • In a separate large saute pan, sweat the onions over medium-low heat in olive oil until they are translucent but haven't taken on any color.
  • In the same milk used to poach the bacalhau, you will cook the potatoes. Cook the potatoes for 10-15 minutes or until fork tender. Remove the potatoes from the milk and place in large bowl for mashing. At this time, discard the bay leaves. Mash the potatoes into a smooth consistency while they are still hot. Add the butter. Once the potatoes have cooled to 140°F or cooler, mix in the egg yolks.
  • Flake the bacalhau into pieces using your hands, or two forks. During this process discard any bones.
  • Mix together the mashed potatoes, flaked bacalhau, chopped parsley, half of the can of black olives and mayonnaise. Taste for seasoning, adjusting salt and pepper as desired.
  • In a casserole dish, first layer in the cooked onions. Top the onions with the potato and bacalhau mixture.
  • Cook in a 350°F oven for about 30 minutes, or until the internal temperature reaches 160°F. Garnish with the remaining black olives and slices of roasted red bell pepper.

Video

Notes

Bacalhau à Zé do Pipo: History, Origins, and Traditions
Bacalhau à Zé do Pipo is one of Portugal’s most beloved comfort dishes, celebrated for its rich flavors and unique preparation. This baked codfish casserole is not only a staple in Portuguese homes and restaurants but also carries a fascinating story that links it directly to the city of Porto and the golden era of Portuguese gastronomy.
The Origin Story
The dish was created in Porto during the mid-20th century by José Valentim, affectionately known as “Zé do Pipo.” Zé do Pipo was the owner of a popular restaurant in Porto, and his inventive approach to traditional ingredients led him to craft this unique recipe. In the 1960s, he entered his codfish creation into a national gastronomic contest organized by the Estado Novo’s National Information Bureau, which sought “The Best Meal at the Best Price.” Bacalhau à Zé do Pipo won first prize, catapulting both the dish and its creator to national fame. As a result, the dish quickly spread throughout Portugal, becoming a classic on restaurant menus and a cherished recipe in Portuguese households.
What Makes Bacalhau à Zé do Pipo Unique?
At its heart, Bacalhau à Zé do Pipo is an oven-baked codfish casserole, but what sets it apart is the unexpected use of mayonnaise—a rarity in traditional Portuguese cuisine. The dish layers desalted cod loins (often poached in milk for extra tenderness), sautéed onions, and sometimes peppers, then covers everything with a generous layer of mayonnaise. Surrounding the cod is a border of creamy mashed potatoes, often piped decoratively. The casserole is baked until golden and gratinéed, then garnished with black olives and sometimes parsley or strips of red pepper.
The combination of flavors and textures is what makes the dish so beloved: the saltiness of the cod, the sweetness of the onions, the creaminess of the mashed potatoes, and the tangy richness of the mayonnaise come together in perfect harmony.
Traditions and Regional Variations
Bacalhau à Zé do Pipo is especially popular in Porto, where it originated, but it has become a staple across the country. It is often served during family gatherings, festive occasions, and in many traditional Portuguese restaurants. While the classic recipe remains the most popular, some variations include the addition of pickles or white wine, or a touch of nutmeg in the mashed potatoes. In the Azores and Madeira, you might find local twists, such as the inclusion of regional peppers or different garnishes.
Keyword bacalhau, bacalhau a ze do pipo, bacalhau casserole, bacalhau with mashed potatoes, mashed potatoes, Portuguese food, Portuguese Salted Cod Shepard's Pie, salt cod, salted cod, salted cod casserole

Recipes

Portuguese / Keto / Seafood / Vegetarian / Breakfast / Dinner

Michael holding plate of pesto crab cakes

Hello, I'm Michael!

I aspire to share recipes that you and your family can enjoy while also learning about cooking fundamentals along the way. I attended the California Culinary Academy in San Francisco, CA and now enjoy cooking as a hobby.

Link to shop Michael's Kitchen Essentials