Homemade Spanish sofrito is a rich, concentrated cooking base made with onions, garlic, ripe tomatoes and extra virgin olive oil. Slowly cooked until thick and full of flavor, it's perfect for Spanish rice dishes, stews and sauces. Make a large batch and freeze in individual portions for easy Mediterranean cooking.
500g1.1 lb / about 3–4 medium onions, preferably Cebolla de Figueres or sweet yellow onions, finely chopped or processed
6–8 garlic clovesabout 25–35 g / 1 oz, peeled
1kg2.2 lb ripe pear-shaped tomatoes or Roma tomatoes, peeled and chopped, or 2 × 14 oz (400 g) cans whole peeled tomatoes plus additional tomato as needed to reach 1 kg
200ml¾ cup plus 1 tbsp plus 1 tsp Spanish extra virgin olive oil, divided
1tspgranulated sugaroptional depending on tomato acidity
1tspfine sea saltplus more to taste
Method
Peel the onions and chop them into smaller pieces. Working in batches if necessary, pulse them in a food processor until very finely chopped and almost paste-like. Avoid adding water. If you don't have a food processor, grate the onions or chop them as finely as possible.
Pour approximately 150 ml (⅔ cup) of the olive oil into a large, wide, heavy-bottomed pan. Add the processed onions and cook over medium-low heat, stirring frequently, for approximately 25–35 minutes. The onions should gradually lose much of their moisture, soften completely and develop a gentle golden color. Adjust the heat as needed to prevent browning too quickly.
Meanwhile, place the peeled garlic cloves in a small food processor or mortar with the remaining olive oil. Process or crush until you have a fairly smooth garlic mixture.
Add the garlic and olive oil mixture to the onions. Cook gently for 2–3 minutes, stirring constantly, until fragrant. Do not allow the garlic to brown.
Add the salt and sugar, if using, and stir well.
Process the peeled tomatoes until you have a fairly smooth purée. Pour the tomatoes into the pan with the onions and garlic and stir thoroughly to combine.
Bring the mixture to a gentle simmer, then reduce the heat to low. Cook uncovered for approximately 60–75 minutes, stirring regularly and scraping the bottom of the pan so the mixture cooks evenly without sticking.
As the sofrito reduces, it will gradually become thicker, darker and more concentrated. Stir more frequently during the final 15–20 minutes, when the risk of sticking is greatest. Continue cooking until most of the excess moisture has evaporated and the mixture forms a thick sauce.
Taste and adjust the salt if necessary. The sofrito should taste rich and mellow, with no pronounced raw onion or raw tomato flavor.
Divide the finished sofrito into shallow, food-safe containers to cool quickly. Refrigerate promptly, within 2 hours of cooking. Once chilled, divide into recipe-sized portions if necessary and freeze in airtight freezer-safe containers or bags, labeled with the weight and date.
To use, thaw overnight in the refrigerator, or heat a frozen portion directly in the pan until fully heated through before continuing with your chosen recipe. Stir as needed and allow any excess moisture to evaporate.
The best onions: Sweet Cebolla de Figueres onions are lovely for sofrito, but ordinary yellow onions work beautifully too. Avoid very sharp raw onion flavors by allowing sufficient cooking time.Fresh or canned tomatoes: Use ripe, flavorful fresh tomatoes when they're in season. For the 1 kg quantity, you can substitute approximately 1 kg (35 oz) canned whole peeled tomatoes, including their juices. Cooking time may vary depending on moisture content.Peeling tomatoes: Score a small cross in the base of each tomato, lower it into boiling water for approximately 30–60 seconds, then transfer to cold water. The skins should peel away easily.Why process the onions? Finely processing the onions creates the smooth texture I prefer for freezer-ready sofrito. Finely chopped onions are also suitable if you prefer a rustic finish.Garlic quantity: Six to eight cloves give the sofrito a noticeable but balanced garlic flavor. Garlic bulb sizes vary considerably, so counting the cloves is more reliable than using half a bulb.Olive oil: This is an olive-oil-rich sofrito intended as a concentrated cooking base. The 200 ml of olive oil helps the onions cook gently and gives the finished mixture richness. Account for this oil when using sofrito in another recipe.Sugar: Sugar is optional. Ripe tomatoes that have been cooked long enough may not need it. Taste before adding extra sweetness.Cooking time: The onions need approximately 25–35 minutes, followed by around 60–75 minutes for the tomatoes to reduce. Your pan size, heat and tomato variety will affect the timing.How to recognize finished sofrito: The mixture should be thick, concentrated and free from excess watery liquid. When you drag a wooden spoon across the bottom of the pan, the sauce should briefly separate before slowly flowing back together.Seasoning: Keep the sofrito moderately seasoned, especially if you're freezing it to use in recipes that will contain additional salt, stock or other seasonings.Portion sizes: For convenient storage, try freezing portions of 50 g (about 1¾ oz), 100 g (about 3½ oz) or 150 g (about 5¼ oz). These are storage suggestions, not universal quantities for paella. Always use the amount appropriate for your particular recipe.Freezing: Freeze in small airtight freezer-safe containers, silicone portion trays or flat freezer bags. Label each portion with its weight and the date. For best flavor and texture, aim to use within approximately 3 months.Refrigerator storage: Keep homemade sofrito refrigerated at 4°C (40°F) or below and use within 3–4 days. Freeze anything you won't use within that period.Safe thawing: Thaw overnight in the refrigerator, in a sealed bag in cold water, or in the microwave if you'll cook it immediately. Small portions can also go directly from the freezer into a saucepan. Do not thaw on the countertop.Using frozen sofrito: Place the frozen portion into the cooking pan and warm it gently until fully heated and bubbling, stirring regularly. Cook off any excess water before adding other ingredients.For traditional paella Valenciana: Do not automatically substitute this onion-based sofrito. Traditional Valencian paella generally uses grated tomato cooked with the meat and vegetables directly in the paella pan.Equipment: A wide pan helps excess moisture evaporate more efficiently. A heavy base makes the long cooking process easier to control.Not suitable for room-temperature storage: Homemade sofrito containing garlic and vegetables in oil must be refrigerated or frozen. Do not store it in sealed jars at room temperature unless using a separately validated preservation method.