Summary: Bacalao encebollado (cod with caramelized onions) is one of the most comforting and simple recipes in Iberian cuisine. It's a dish where the humble ingredients—salted cod and onion—are transformed into something extraordinary thanks to a key technique: the slow caramelization of the onion for at least 30 minutes. This recipe guides you step-by-step to achieve perfect bacalao encebollado, with silky, sweet onions embracing a juicy, flaky cod loin.
Table of Contents
Origin of Bacalao Encebollado: Iberian Tradition
Bacalao encebollado is a dish with deep roots in both Spanish and Portuguese cuisine. In Portugal, where cod is practically a national symbol, bacalhau com cebola is one of the most popular and everyday preparations. In Spain, especially in the northern regions and the Mediterranean coast, bacalao encebollado has been part of traditional recipes for centuries.
The history of this dish is intimately linked to the preservation of cod in salt. For centuries, salted cod was one of the few accessible fish in the interior of the peninsula, far from the sea. Its long shelf life made it the perfect protein for Lent and vigils, when the Church prohibited the consumption of meat. Onion, a humble and omnipresent ingredient in any kitchen, was the natural accompaniment.
What is fascinating is how such a simple dish—essentially cod and onion—can achieve extraordinary levels of flavor. The secret lies in the slow caramelization of the onion. When the onion is cooked over low heat for 30-45 minutes, its natural sugars transform through the Maillard reaction, changing from a pungent and acrid taste to a deep, complex, and silky sweetness. This caramelized onion envelops the cod with a natural sauce that needs no other additions.
In Portuguese tradition, bacalhau com cebola is frequently served with boiled potatoes and hard-boiled egg, forming a complete and nutritious meal. In the Spanish version, it is more common to serve it as a single dish accompanied by bread for dipping in the juices. At Mercat del Ninot, since 1990, we have been selecting perfect Icelandic cod loins for this preparation—thick pieces of firm, white flesh that flake when touched with a fork.
Today, we share this recipe with the ambition that you can achieve the same result at home as in Portuguese taverns and Spanish homes where this dish is cooked with love and, above all, with patience. Because bacalao encebollado has no complicated secrets: it only requires good ingredients and time.
Ingredients for Bacalao Encebollado
For 4 people
- 4 dried cod loins (about 200g each, desalted)
- 6 large onions (approximately 1.2 kg) — the more onion, the better
- 100 ml extra virgin olive oil
- 3 cloves garlic, thinly sliced
- 2 bay leaves
- 100 ml dry white wine (optional but recommended)
- 1 teaspoon sweet paprika (from La Vera if possible)
- Ground black pepper
- Fresh chopped parsley for garnish
- Black olives (optional, Portuguese style)
Notes on Ingredients
Onions: The onion proportion is generous on purpose. For good encebollado, you need a lot of onion because it reduces enormously during cooking—1 kg of raw onion shrinks to barely 300-400g of caramelized onion. Use sweet onions if you can find them (like Fuentes de Ebro or Figueres onions); otherwise, regular white or yellow onions work perfectly.
Cod: The loin is the star cut for this recipe. It is the thickest and noblest part of the cod, with firm flesh that flakes into large, juicy pieces. Avoid thin cuts or tails, which would dry out. A good, thick, well-desalted Icelandic cod loin makes the difference between a decent dish and a memorable one.
Olive oil: Use a medium-quality extra virgin olive oil—smooth, not pungent. The oil blends with the onion juices to form the dish's natural sauce.
Related Bacalalo Products
The Caramelized Onion Technique (30+ minutes)
Caramelizing the onion is the most important step in this recipe. It's not about quickly sautéing the onion or browning it over high heat—that would burn the outside while leaving the inside raw. True caramelization is a slow process that completely transforms the onion.
What happens during caramelization?
Onions contain between 5% and 8% natural sugars (fructose, glucose, and sucrose). Over low heat, these sugars are slowly released as the onion's water evaporates. When the temperature exceeds 110°C, the Maillard reaction begins—a chemical reaction between sugars and proteins that generates hundreds of new aromatic compounds. It's the same reaction that browns bread crust, toasts coffee, or caramelizes crème brûlée.
The result is an onion that goes from white to blonde, from blonde to golden, and from golden to a deep, shiny brown, with a silky texture and a complex flavor where sweet, umami, and a slight smoky touch coexist.
Step-by-step caramelization
Minutes 0-5: Slice the onions thinly into julienne (half-moons 3-4 mm thick). Place them in a wide pan or casserole dish with olive oil over medium heat. Stir to coat them in oil. Add a pinch of salt—this helps extract moisture and slightly speeds up the process.
Minutes 5-10: The onions begin to release water and soften. The volume visibly reduces. Lower the heat to medium-low. Stir every 3-4 minutes.
Minutes 10-20: The onions are translucent and begin to turn a light blonde color. Most of the water has evaporated. Lower the heat to minimum. This is the critical moment: if the heat is too high, the onion will burn instead of caramelizing. Stir every 2-3 minutes, scraping the bottom with a wooden spoon.
Minutes 20-30: The onions are golden and begin to darken. The aroma changes—it goes from a raw onion smell to a sweet and toasted aroma. If they stick to the bottom, add a tablespoon of water and scrape—those stuck bits (fond in French terminology) are full of flavor.
Minutes 30-45: The onions are deep brown, shiny, and silky. They have reduced to a third of their original volume. The flavor is intensely sweet, with caramel notes and a slight smoky background. This is the perfect point.
The most common mistake is impatience. Many recipes say "sauté the onion for 10 minutes until transparent"—that is NOT caramelizing. True caramelization needs at least 30 minutes over low heat, and 45 minutes yields an even better result. There are no shortcuts: higher heat burns the onion instead of caramelizing it.
Step-by-Step Recipe
Step 1: Desalt the cod (24-48 hours before)
Place the dried cod loins in a large container with plenty of cold water. Place them skin-side up (the salt leaches out through the flesh, not the skin). Refrigerate for 36-48 hours, changing the water every 8-10 hours (at least 3-4 changes). Thick loins need more desalting time than thinner pieces.
To check the salt level, cut a small piece from the center of the loin and taste it. It should have a slightly salty, pleasant flavor—neither bland nor excessively salty. Properly desalted cod is the base of any successful recipe.
Step 2: Caramelize the onions (30-45 minutes)
Slice the 6 onions thinly into julienne. In a large casserole (or large lidded skillet), heat the olive oil over medium heat. Add the onions with a pinch of salt. Follow the technique described in the previous section, cooking them over low heat for 30-45 minutes until they are dark brown, silky, and sweet.
In the last 5 minutes of caramelization, add the sliced garlic and bay leaves. Cook until the garlic is golden but not burned. Sprinkle the sweet paprika, stir quickly (paprika burns in seconds), and immediately deglaze with the white wine. Let the alcohol evaporate for 2-3 minutes.
Step 3: Cook the cod
Pat the cod loins dry with paper towels. You have two options for cooking:
Option A — All in one pot (more traditional method): Place the cod loins on top of the bed of caramelized onions, skin-side up. Cover the pot, lower the heat to minimum, and cook for 15-20 minutes. The cod will steam with the onion juices, resulting in extremely juicy and tender fish.
Option B — Sear cod separately (more flavor): In a separate pan with a drizzle of oil, sear the cod loins over medium-high heat, first on the skin side for 3-4 minutes until crispy. Flip and cook for another 2 minutes on the flesh side. The skin should be golden and crispy. Place the loins on top of the caramelized onions and cover the pot for 5 minutes to let the flavors meld.
The cod is ready when the flesh easily separates into flakes when pressed with a fork. Do not overcook it—overcooked cod becomes dry and fibrous, losing all its juiciness.
Step 4: Plate and Serve
Place a generous base of caramelized onions on each plate. Put the cod loin on top. Drizzle with the juices from the pot. Sprinkle with fresh chopped parsley and, if you want to follow Portuguese tradition, add some black olives.
Serve immediately with crusty bread for dipping in the sauce—those caramelized onion juices with olive oil and cod juices are liquid gold that deserves every last crumb.
Related Bacalalo Products
Tips for Perfect Bacalao Encebollado
- Onion-cod ratio: Use at least 300g of raw onion per cod loin. It may seem excessive, but when caramelized, onion reduces to one-third of its volume. More onion = more sauce = more flavor.
- Do not add sugar: The temptation to speed up caramelization with sugar exists, but resist it. Onions have enough natural sugars. Added sugar provides an artificial, cloying sweetness that is nothing like the deep flavor of natural caramelization.
- Low heat, always low: The difference between caramelized onion and burned onion is just a notch on the thermostat. If in doubt, lower the heat further. Burned onion has a bitter taste that will ruin the entire dish.
- Deglaze with water: If the bottom of the pot darkens too much during caramelization, add a tablespoon of water and scrape with a wooden spoon. Those bits on the bottom (fond) are pure concentrated flavor.
- The cut matters: Cut the onion into julienne (half-moons) along the natural grain, not diced. Julienne caramelizes more uniformly and results in silky strands that envelop the cod. Diced onions are irregular.
- Cod skin: Do not remove the cod skin. Besides protecting the flesh during cooking, the skin provides gelatin that enriches the sauce. If you sear it separately (Option B), crispy skin adds a spectacular textural contrast.
- Final resting: Let the dish rest, covered, for 5 minutes before serving. This allows the juices to redistribute in the cod and the temperature to stabilize. The cod becomes juicier with this brief rest.
How to Choose the Ideal Cod Cut
Not all cod cuts are equal for encebollado. This guide will help you choose:
| Cut | Thickness | Ideal for | Encebollado |
|---|---|---|---|
| Loin (center) | 4-5 cm | Roasting, baking, encebollado | Perfect |
| Extra loin | 5-6 cm | Main courses, confit | Excellent |
| Penca (belly/rib section) | 3-4 cm | Pil pil, battered | Good |
| Tail | 1-2 cm | Stews, flaked | Not recommended |
| Flaked/Shredded | Variable | Fillings, salads | Not recommended |
The loin is the star cut for encebollado. Its thickness allows for prolonged cooking without drying out, and when served, it separates into large, thick, juicy flakes. The extra loin, even thicker, yields spectacular results if you're aiming for a restaurant-quality dish at home.
Icelandic cod is the most prized origin for encebollado. The cold waters of the North Atlantic produce cod with denser, whiter, and firmer flesh than other origins. When desalted, it maintains its structure without falling apart, and when cooked, it flakes into defined pieces with a texture that is impossible to match with cod from warmer waters.
Accompaniments and Variations
Classic accompaniments
- Boiled potatoes: The quintessential Portuguese accompaniment. Whole potatoes cooked with skin, peeled and cut into thick slices, soaked in the onion sauce. Simple and perfect.
- Patatas panaderas (sliced baked potatoes): Thinly sliced and baked with olive oil and rosemary. They can be placed under the cod and onion in the casserole for the final baking.
- Country bread: Essential for dipping in the juices. A rustic bread with a crispy crust and dense crumb is ideal.
- White rice: A heartier option that wonderfully absorbs the onion sauce.
- Green salad: A simple mix of green leaves with a lemon vinaigrette to counteract the richness of the dish.
Portuguese variation: Bacalhau à Brás
The most famous variant of cod with onion. The cod is flaked and sautéed with julienned onion and straw potatoes (cut into very fine strips and fried). Everything is bound with beaten eggs, creating a scrambled and creamy mixture. It is garnished with black olives and parsley. It is an iconic dish of Portuguese cuisine.
Variation with peppers
Add 2 red peppers, cut into strips, to the caramelization along with the onions. The peppers add extra sweetness and a vibrant color to the dish. This is a popular variation in Extremadura and the Portuguese Alentejo.
Baked variation
Instead of cooking in a casserole, assemble the layers in a baking dish: caramelized onion as a base, cod loins on top, more onion covering, a drizzle of oil, and bake at 180°C (350°F) for 20-25 minutes covered with aluminum foil. For the last 5 minutes, uncover to brown slightly. This technique is ideal for serving many guests.
Frequently Asked Questions
How long does it take to properly caramelize onions?
At least 30 minutes over low heat, ideally 40-45 minutes. True caramelization cannot be rushed without compromising the result. Over low heat, the onion slowly transforms: first it softens, then it browns, and finally it reaches a deep brown color with a sweet and complex flavor. Patience is the secret ingredient.
Can I use fresh cod instead of salt cod?
Yes, although the result will be different. Salted and desalted cod has a firmer texture and more concentrated flavor than fresh cod. If you use fresh cod, reduce the cooking time to 10-12 minutes and add salt to the dish. Fresh cod is more delicate and tends to flake more easily.
What type of onion is best for encebollado?
Sweet onions (such as Fuentes de Ebro, Figueres, or Vidalia) give the best result because they have more natural sugars and fewer sulfuric compounds. However, common yellow or white onions work perfectly—they simply need a few more minutes of caramelization. Avoid red onions, which can give an unappetizing grayish color.
How much onion should I use per person?
Estimate at least 250-300g of raw onion per person. It seems like a lot, but onion reduces to a third of its volume during caramelization. It's better to use too much onion than too little—a mountain of caramelized onion covering the cod is what makes this dish spectacular.
Can bacalao encebollado be prepared in advance?
Yes. You can caramelize the onions in advance (even the day before) and refrigerate them. It is best to cook the cod just before serving. You can also assemble the entire dish and reheat it over low heat for 10 minutes or in the oven at 160°C for 15 minutes. The flavors even integrate better the next day.
Why shouldn't I add sugar to caramelize onions?
Onions contain 5-8% natural sugars, which are sufficient for caramelization. Adding sugar results in an artificial, one-dimensional sweetness that masks the complexity of natural caramelization. The Maillard reaction between the onions' own sugars and proteins generates hundreds of aromatic compounds that added sugar cannot replicate.
Conclusion
Bacalao encebollado is proof that great cooking doesn't require many ingredients or complicated techniques. It requires quality produce, precise technique, and, above all, patience. The 30-45 minutes of caramelizing the onion are not wasted time — they are the time that transforms a humble ingredient into something extraordinary.
A good, thick-cut loin of Icelandic cod, carefully desalted and lovingly cooked over a bed of slowly caramelized onions: there is no dish more honest or more satisfying. It is rooted cooking, the kind that nourishes body and soul, and that is passed down from generation to generation because it doesn't need modernization to remain perfect.
If you've never truly caramelized onions — those 30 minutes over low heat that change everything — we invite you to try it with this recipe. You'll discover a level of flavor you didn't know onions could reach, and your bacalao encebollado will never be the same.
Discover more





