Bacalhau Recipe: Traditional Portuguese Cod and Potatoes

Updated November 3, 2026

Total time
25 hr 25 min
prep 24 hr 30 min · cook 55 min
Serves
6
portions as written
Safe temperature (USDA)
145°F / 63°C
check the thickest piece

Jump to recipe

Bacalhau Recipe: Traditional Portuguese Cod and Potatoes

Bacalhau à Gomes de Sá is a traditional Portuguese baked dish from Porto, made with salt cod, potatoes, onions, olive oil, hard-boiled eggs, and olives. The fish is soaked to remove excess salt, then layered with tender potatoes and slowly softened onions for a savory, comforting casserole; Portuguese households make it in several versions, so this is a classic home-style approach rather than the only traditional one.

Ingredients

  • 1½ lb (680 g) dried salted cod, preferably thick center-cut pieces
  • 8 cups (1.9 L) cold water for each soak, replaced every 6 hours
  • 2 lb (900 g) waxy or all-purpose potatoes, such as Yukon Gold
  • 2 cups (480 ml) whole milk, for poaching the cod
  • ⅓ cup (80 ml) extra-virgin olive oil, divided
  • 2 large yellow onions, about 1 lb (450 g) total, thinly sliced
  • 3 garlic cloves, about 1 tbsp (9 g), thinly sliced
  • 1 bay leaf, about 0.2 g
  • 4 large eggs, about 200 g without shells
  • ½ cup (75 g) pitted black olives, whole or halved
  • ½ cup (15 g) chopped fresh flat-leaf parsley, plus a little for garnish
  • ½ tsp (1 g) freshly ground black pepper
  • Up to ¼ tsp (1.5 g) fine salt, only if needed after tasting

Instructions

  1. Desalt the cod. Rinse the salt cod under cold running water to remove surface salt. Put it in a large nonreactive bowl, cover with 8 cups (1.9 L) cold water, and refrigerate for 24 hours. Replace the water every 6 hours, using fresh cold water each time. Keep the fish refrigerated throughout the soak; do not leave it on the counter. If your pieces are unusually thick or the package recommends a longer soak, follow that guidance and allow more time. After soaking, taste a tiny cooked flake if you are unsure about the salt level: it should taste pleasantly seasoned, not harshly salty.
  2. Cook the potatoes and eggs. Drain the cod and set it aside. Scrub the potatoes and put them in a pot with enough cold water to cover by about 1 inch (2.5 cm). Bring to a boil, then simmer until a knife enters with slight resistance, usually 18 to 22 minutes depending on size. Drain and let them cool until easy to handle. In a separate small saucepan, cover the eggs with water, bring to a boil, then turn off the heat, cover, and leave for 10 to 12 minutes. Transfer them to cold water. Peel once cool; the yolks and whites should be firm. Slice the potatoes into rounds about ⅜ inch (1 cm) thick and the eggs into wedges or rounds.
  3. Poach and flake the fish. Put the drained cod in a wide saucepan and pour in the milk. Add the bay leaf and enough water to mostly cover the fish if needed. Bring the liquid just to a gentle simmer, then cook for about 6 to 10 minutes, turning thick pieces once, until the cod is opaque and separates into flakes. Check the thickest part with a food thermometer: the USDA FSIS safe minimum for fish is 145°F (63°C). Lift the cod onto a plate and cool briefly. Remove skin and any bones, then break the fish into large flakes; avoid shredding it too finely so it remains distinct in the finished dish. Strain and reserve about ½ cup (120 ml) of the poaching liquid.
  4. Soften the onions. Heat the oven to 375°F (190°C). Warm ¼ cup (60 ml) of the olive oil in a large skillet over medium-low heat. Add the sliced onions and cook for 12 to 15 minutes, stirring occasionally, until soft, glossy, and lightly golden at the edges. They should turn sweet and tender rather than brown or crisp. Stir in the garlic and black pepper for the final minute. If the pan looks dry, add a spoonful of the reserved poaching liquid instead of turning the heat up.
  5. Layer the casserole. Brush a 9-by-13-inch (23-by-33-cm) baking dish with a little of the remaining oil. Arrange about half the potato slices in an even layer, followed by half the onions and half the cod. Repeat with the remaining potatoes, onions, and cod. Drizzle the remaining oil and up to ½ cup (120 ml) reserved poaching liquid over the layers; use less if the dish already looks moist. The liquid should gather lightly at the bottom, not flood the ingredients. Taste a small piece of cod before adding salt, since salt cod varies considerably even after soaking.
  6. Bake and finish. Bake uncovered for 20 to 25 minutes, until hot throughout and lightly golden in places. Check the center with a food thermometer; because this is a cooked egg-and-fish casserole, the USDA FSIS safe minimum for an egg dish is 160°F (71°C). If the top needs more color, broil briefly while watching closely. Scatter the parsley over the casserole and arrange the egg slices and olives on top. Rest for 5 minutes, then serve warm. The eggs and olives can be placed on the casserole before baking if you prefer them warmed through, but adding them afterward keeps their color and texture fresher.

Tips

  • Desalt patiently and taste before seasoning. Salt cod is preserved with a substantial amount of salt, and thickness, curing, and soaking time all affect the result. A full 24-hour refrigerated soak with regular water changes works for many pieces, but thick cuts may need longer. Do not add the optional salt until the casserole is assembled and you have tasted the fish.
  • Choose potatoes that hold their shape. Waxy potatoes make neat slices, while all-purpose potatoes are a little softer but still work well. Avoid overcooking them during the first simmer; they will continue to heat in the oven. If they split or crumble, layer them gently and the dish will still taste good, though it will be less defined.
  • Keep the onions sweet, not browned. Low-to-medium-low heat gives the onions time to soften and develop flavor without scorching. If they begin sticking, add a tablespoon of water or reserved poaching liquid and lower the heat. Burnt garlic or deeply browned onions can make the casserole taste bitter.
  • Use a practical substitute when needed. If salted cod is unavailable, use fresh or frozen unsalted cod, thawed in the refrigerator, and skip the soaking and desalting steps. Poach it gently in the milk until it reaches 145°F (63°C), and season the layers lightly. The result will be milder and less characteristically savory than bacalhau, so taste before adding salt. A mild, firm white fish such as pollock can also work, though it will have a softer texture.

Serving Suggestions

Serve the casserole warm, bringing the baking dish to the table if convenient. Its potatoes, fish, and eggs make it a substantial main course, so simple accompaniments are usually best. A crisp green salad dressed with olive oil and vinegar adds freshness, while steamed green beans, sautéed greens, or lightly dressed lettuce offer a useful contrast to the rich, soft layers. Crusty bread is welcome for soaking up the olive oil and juices, but it is not essential.

For a Portuguese-inspired table, put extra olives and chopped parsley out separately so diners can add them to taste. A lemon wedge is not required, but a small squeeze can brighten an especially rich serving. Portion the casserole with a broad spatula, aiming to include potato, onion, and cod in each serving. If serving a crowd, keep the dish warm in a low oven only briefly; extended holding can dry the fish and soften the potatoes further.

Variations

Bacalhau à Gomes de Sá has regional and household variations. Some cooks poach the fish in milk, as in this recipe; others cook it in water or use less liquid. You can leave the cod in larger pieces for a more pronounced fish texture, or flake it smaller so it distributes evenly. A little more parsley or a few extra olives changes the finish without changing the basic character of the dish.

For a less rich version, reduce the olive oil to ¼ cup (60 ml) and add a few tablespoons of reserved poaching liquid to keep the layers moist. You can also use red onions for a slightly sweeter, more colorful result. If you do not eat olives, omit them and add a few capers for a briny accent; capers taste sharper and saltier, so use them sparingly and rinse them first. Fresh cod can stand in for salt cod as described in the tips, but it will not reproduce the same deeply seasoned flavor. Keep the potatoes, gently cooked onions, and olive oil as the foundation for the recognizable Gomes de Sá-style combination.

Storage and Reheating

Let leftovers cool briefly, then refrigerate them within 2 hours of cooking in a covered, shallow container. Store for 3 to 4 days in the refrigerator. For best texture, keep portions intact rather than stirring the casserole, and place the eggs and olives with the portions they accompany. Do not leave the casserole at room temperature for more than 2 hours, or more than 1 hour in very hot conditions above 90°F (32°C).

Reheat only the portion you plan to eat. Cover it loosely and warm it in a 325°F (163°C) oven until hot throughout, or use a microwave in short intervals, turning the portion if possible. Check the center with a thermometer and reheat leftovers to 165°F (74°C), the USDA FSIS recommendation. Add a teaspoon or two of water or milk before reheating if the potatoes look dry. The fish may become firmer after reheating, so use gentle heat and avoid warming the same portion repeatedly. For longer storage, freeze tightly wrapped portions for up to 2 months for best quality; thaw overnight in the refrigerator and reheat to 165°F (74°C).

Frequently Asked Questions

How long should I soak salt cod?
For the pieces in this recipe, plan on 24 hours in the refrigerator, replacing the water every 6 hours. Very thick pieces can require longer, and package directions are useful because saltiness varies by producer and cut. Keep the fish cold while soaking, then taste a small cooked flake before seasoning the casserole.

Can I make this with fresh cod?
Yes. Use an equal weight of fresh or thawed frozen cod, omit the long soak, and poach it gently in milk until the thickest part reaches 145°F (63°C). Fresh cod is much less salty and has a milder flavor than bacalhau, so season the potatoes and onions lightly and adjust only after tasting.

Can I prepare the casserole ahead?
You can soak the cod up to the point of draining, and you can boil the potatoes and eggs and soften the onions a day ahead. Refrigerate those prepared components promptly in separate covered containers. For the best texture, assemble and bake the casserole on the day you plan to serve it; if you assemble it ahead, keep it refrigerated and allow extra baking time until the center reaches 160°F (71°C).

Why does my bacalhau taste too salty?
The cod may need a longer soak, the water may not have been changed often enough, or the fish may be especially heavily cured. Soak it longer in fresh cold water in the refrigerator, changing the water every few hours, and taste a cooked flake before assembling. Avoid adding salt elsewhere, and serve with unsalted potatoes or a plain salad to balance a slightly salty batch.

Can I freeze the finished dish?
Yes, though the potatoes can become softer and the eggs may change texture after freezing. Cool and refrigerate the casserole promptly first, then freeze individual portions in airtight containers for up to 2 months for best quality. Thaw in the refrigerator and reheat until the center reaches 165°F (74°C); do not thaw it on the counter.

Related

More recipes to cook

Safety notes: safe minimum internal temperatures from USDA FSIS; raw and undercooked fish guidance from the U.S. FDA. Food safety notes

Spotted an error? Tell us and we will correct it (corrections policy).