Baked Pasta with Caramelized Onions and Gruyère
Photo by Shameel mukkath on Pexels

Baked Pasta with Caramelized Onions and Gruyère

This French-Italian fusion bake marries the slow-cooked sweetness of caramelized onions with a silky Gruyère béchamel, all crowned with buttered breadcrumbs for textural contrast. It's a showstopping vegetarian main course with elegant flavors and rustic comfort—simple enough for a weeknight, special enough for guests.

Prep
20 min
Cook
1 hr 35 min
Wait
5 min
Total
2 hr
Makes
Serves 5 (about 1½ cups per serving)
Share

Steps

Before you start
  • Read through all steps to understand the timing—caramelizing onions takes the longest and sets the pace for the whole dish.
  • Slice the onions thinly and evenly so they caramelize at the same rate; gather and measure all other ingredients (mise en place) before starting.
  • Plan to preheat the oven while the onions are finishing—timing works well this way.
  • Have a 9×13-inch (23×33 cm) baking dish buttered and ready before you begin assembly.
  1. Caramelize the onions

    • In a large (12-inch/30 cm) skillet, combine the butter and olive oil over medium heat.
    • Once the butter is foaming, add the sliced onions and thyme sprigs.
    • Cook for 45–50 minutes, stirring occasionally every 5–10 minutes, until the onions are deeply golden brown and very soft, with a sweet, caramel-like aroma and no sharp texture remaining.
    • Season with salt and pepper to taste.
    • Remove and discard the thyme sprigs.
    • Transfer the caramelized onions to a plate.
    + Show details

    Ready when: Onions are deeply golden brown, very soft, and smell sweet and caramel-like

    Tip: Don't rush this step—patience and medium heat are crucial. Too-high heat will burn the onions before they caramelize. If they begin to stick, add a splash of water and stir.

  2. Make the béchamel sauce

    • In a large saucepan, melt the butter over medium heat.
    • Add the flour and whisk constantly for 1–2 minutes to form a smooth roux; it should smell nutty but not brown.
    • Gradually pour in the milk and cream while whisking continuously to prevent lumps.
    • Continue whisking and cooking for 5–7 minutes until the sauce thickens and coats the back of a spoon.
    • Remove from heat and stir in the grated Gruyère cheese until completely melted and smooth.
    • Season with a pinch of nutmeg, salt, and pepper to taste.
    + Show details

    Ready when: Sauce is smooth, thickens and coats the back of a spoon, and cheese is fully melted

    Tip: Whisk constantly to prevent lumps from forming. If lumps do form, strain the sauce through a fine-mesh sieve before using.

  3. Cook the pasta

    • Bring a large pot of salted water to a boil over high heat (about 6–8 quarts of water).
    • Once at a rolling boil, add the pasta and cook for 1–2 minutes less than the package instructions—you want it al dente, still with just a slight firmness when bitten.
    • Drain in a colander and set aside.
    • Do not rinse.
    + Show details

    Ready when: Pasta is al dente—tender but still with slight resistance when bitten

    Tip: Undercook the pasta by 1–2 minutes intentionally; it will cook further in the oven. Overcooked pasta will become mushy in the bake.

  4. Preheat the ovenOven 375°F / 190°C

    • Preheat your oven to 375°F (190°C).
    • Timing this to finish while you assemble the other components works best.
  5. Combine pasta, onions, and sauce

    • In a large mixing bowl, combine the cooked pasta, caramelized onions, and béchamel sauce.
    • Using a flexible spatula or wooden spoon, fold gently and carefully until the pasta is evenly coated and all ingredients are well combined.
    • Transfer the mixture to a buttered 9×13-inch (23×33 cm) baking dish, spreading it into an even layer.
    + Show details

    Ready when: All ingredients are evenly combined and the mixture is spread level in the baking dish

    Tip: Fold gently to avoid breaking the pasta. The goal is even distribution and coating, not a smooth purée.

  6. Make and apply the topping

    • In a small bowl, combine the panko breadcrumbs, melted butter, and grated Gruyère cheese.
    • Mix gently with a fork or your fingers until the breadcrumbs are evenly moistened and coated with butter and cheese.
    • Sprinkle this mixture evenly over the pasta in the baking dish.
    + Show details

    Ready when: Breadcrumbs are evenly coated with butter and cheese; topping is spread evenly over pasta

    Tip: Don't overmix—gentle tossing keeps the breadcrumbs light. Overmixing will pack them down and result in a dense topping.

  7. Bake until goldenOven 375°F / 190°C

    • Place the baking dish in the preheated 375°F (190°C) oven and bake for 25–30 minutes.
    • The top should turn golden brown and the edges of the pasta should be bubbling gently.
    • A fork inserted into the center should feel hot to the touch (the internal temperature of the filling should reach at least 165°F/74°C, though this is naturally achieved during baking).
    + Show details

    Ready when: Top is golden brown, edges are bubbling, and center is hot throughout

    Tip: If the top begins to brown too quickly before the center is hot, loosely cover with foil for the last 10 minutes of baking.

  8. Rest and serve

    • Remove from the oven and let rest for 5 minutes.
    • This allows the béchamel to set slightly, making the pasta easier to portion and serve without falling apart.
    • Top with fresh thyme leaves if desired.
    • Serve warm directly from the baking dish or plated individually.
    + Show details

    Tip: The 5-minute rest is important—it gives the structure time to firm up so the pasta doesn't collapse when you serve it.

Good to know

Tips
  • Don't rush the caramelization. Low-to-medium heat and patience over 45–50 minutes develop incomparable sweetness and depth. This is the soul of the dish.
  • Always cook pasta al dente (1–2 minutes under package time), as it will continue cooking in the oven and will become mushy if you start with fully tender pasta.
  • If making this ahead, you can assemble it in the baking dish and refrigerate for up to 1 day. Add 5–10 minutes to the bake time if baking from cold.
  • The 5-minute rest after baking is not optional—it allows the sauce to set, making serving much cleaner and easier.
Make ahead

You can prepare the caramelized onions and béchamel sauce up to 1 day ahead. Store them separately in airtight containers in the refrigerator. On baking day, bring them to room temperature or warm slightly, then assemble and bake as directed. If ingredients are cold, add 5–10 minutes to the bake time.

Storage & reheating

Store leftover baked pasta in an airtight container in the refrigerator for up to 3 days. Reheat in a 350°F (175°C) oven, covered with foil, for 15–20 minutes until hot throughout. You can also freeze in a covered airtight container for up to 2 months; thaw overnight in the refrigerator before reheating using the same method.

Substitutions
  • Gruyère cheese, finely grated → Swiss cheese (Emmental) or aged sharp Cheddar. Both melt smoothly and have nutty, complex flavors. Aged Cheddar is sharper and may overpower the onions slightly, so taste and adjust seasoning.
  • Gruyère cheese, finely grated → Parmigiano-Reggiano or a 50/50 blend of Gruyère and Parm. Parmigiano is harder and won't melt as much, creating a crisper topping. A blend gives you creamy and crispy textures.
  • Penne or rigatoni pasta → Any short, sturdy pasta shape (shells, fusilli, farfalle, elbow, or ditalini). Avoid long pasta like spaghetti or linguine—they don't hold the sauce well in a baked dish. Shapes with nooks trap sauce better.
  • Heavy cream → Whole milk (use 3 cups total milk instead of 2 cups + 1 cup cream) or plain Greek yogurt (whisk 1 cup yogurt with a splash of milk to reach sauce consistency). All milk creates a lighter, less rich sauce; yogurt adds tanginess and creaminess. Both work well; adjust salt and pepper to taste.

More baked pasta

See all →

Find more like this

Meal
Dinner
Cuisine
French
Main ingredient
Pasta

Reviews (0)