Main Courses
This bean gratin recipe delivers the perfect marriage of textures: a golden, crispy cheese crust that shatters at every bite, enclosing tender, creamy white beans and rich béchamel. The key to success lies in the layering technique—each component must be assembled with precision to achieve that restaurant-quality finish. I've perfected this dish over years of testing, and it's become a staple for cozy weeknight dinners that feel like a gourmet experience.
The foundation begins with high-quality cannellini beans, simmered until their natural sweetness emerges. A velvety béchamel sauce, enriched with a touch of Dijon mustard for depth, binds everything together, while sharp cheddar and Gruyère create that irresistible crispy top.
The beauty of this recipe is its versatility—it works equally well as a vegetarian main or alongside grilled proteins for a hearty meal.
What you'll achieve is a dish that's impossible to resist: the first forkful delivers that satisfying crunch from the cheese crust, followed by the warm, creamy bean heart that melts in your mouth.
The aroma alone—warm cheese, simmering beans, and buttery sauce—will have everyone gathered around the table. This is comfort food at its finest, elevated with professional techniques you can master at home.
Serve with a simple green salad and crusty bread to soak up every last bit of that creamy sauce. The leftovers reheat beautifully, making it perfect for meal prep or feeding a crowd. Let's create this showstopping dish that combines simplicity with restaurant-quality results.
Ingredients for bean gratin
Sixteen ingredients for a showstopping vegetarian dish that's crispy, creamy, and restaurant-worthy.
| Ingredient | Amount | Notes |
|---|---|---|
| Cannellini Beans 🌾 | 2 cans | High-quality, drained and rinsed |
| Heavy Cream 🥛 | 1 ½ cups | Full-fat for velvety texture |
| Unsalted Butter 🧈 | ½ cup | Cold, cubed for béchamel |
| All-Purpose Flour 🌾 | ½ cup | For smooth béchamel base |
| Dijon Mustard 🍯 | 1 tbsp | For depth of flavor |
| Sharp Cheddar Cheese 🧀 | 2 cups | Shredded, sharp variety |
| Gruyère Cheese 🧀 | 1 cup | Shredded, nutty flavor |
| Garlic Cloves 🧄 | 3 cloves | Minced for aromatic base |
| Yellow Onion 🧅 | 1 whole | Diced, for béchamel |
| Vegetable Stock 💧 | 1 cup | Low-sodium preferred |
| Salt 🧂 | 1 tsp | Kosher or sea salt |
| Ground Black Pepper 🌶️ | ½ tsp | Freshly cracked |
| Nutmeg 🌿 | ¼ tsp | Freshly grated |
| Fresh Thyme 🌿 | 2 sprigs | Leaves only for garnish |
The cannellini beans are the heart of this dish—look for high-quality brands like Goya or Calhoun in the canned section. Drain and rinse them well to remove any excess sodium. For the cheeses, Gruyère from France or Wisconsin makes all the difference in that crispy top layer. I always buy my Gruyère pre-shredded from Whole Foods for convenience, but a fresh block grated yourself is even better. The sharp cheddar? Cabot or Tillamook are my go-tos—they've got that perfect balance of tang and melt. Don't skip the nutmeg; it's what gives that classic gratin aroma.
No Gruyère? Parmesan or Comté can step in, though the flavor will differ slightly. Short on vegetable stock? Chicken-free bouillon cubes work in a pinch, but add a splash of lemon juice to balance the flavor. The Dijon mustard is non-negotiable for that depth—Maille or whole-grain mustard both work. For the béchamel, if you're worried about lumps, whisk the flour into the cold butter first before adding liquid. And if you're making this ahead, pre-shred the cheeses—it saves time later and prevents that dreaded clumpiness when baking.
This reheats beautifully—450°F for 15-20 minutes until bubbly and golden. The leftovers keep for 4-5 days in the fridge, though I've never had any last that long. For freezing, assemble the gratin, bake until just set (not fully browned), then freeze for up to 3 months. The texture holds up surprisingly well. I always make a double batch—one for dinner, one for lunches the next week. The cheese crust gets even more addictive the second time around.
Why You'll Love This Recipe
- One-Pan Magic: I swear by this for nights when I’d rather scroll than chop. Just dump cannellini beans into a dish, toss them in a roux of butter and flour, then blanket it with cream and mustard—no extra bowls, no extra stress.
- Creamy Crispy Obsession: That golden crust? It’s the flour-butter magic meeting the oven. Inside, it’s velvety from the heavy cream and mustard, while the edges get just crispy—like a hug for your taste buds.
- Leftover Hero: Make it once, eat it twice. The texture holds up beautifully, and the flavors deepen overnight. I’ll often reheat slices straight from the fridge for a lazy breakfast or a quick lunch.
- Budget Luxury: Canned beans and a few pantry staples make this feel fancy without breaking the bank. Honestly, it’s the kind of dish where you won’t even miss the pricey ingredients—just the satisfaction of a rich, satisfying bite.
Step-by-step instructions for bean gratin with perfect texture
This method delivers that dreamy contrast—crispy golden top, creamy bean center—every single time.
Prepare the Cannellini Beans for Maximum Creaminess
Drain and rinse the 2 cans of cannellini beans thoroughly under cold water. I like to give them a quick pat dry with paper towels to remove any excess moisture that could make the béchamel watery. Transfer them to a mixing bowl and mash about one-third of them with a potato masher or fork—just enough to create a thick, chunky texture. The remaining beans stay whole for that delightful bite. Real talk: don't over-mash, or you'll lose that satisfying texture contrast.
Season the beans generously with the 1 teaspoon salt, ½ teaspoon black pepper, and ¼ teaspoon nutmeg. Taste and adjust—this is your flavor foundation. The nutmeg might seem subtle now, but it'll bloom beautifully as the gratin bakes. Set the seasoned beans aside while you prepare the béchamel.
Make the Perfect Béchamel for Creamy Binding
In a medium saucepan, melt the ½ cup unsalted butter over medium heat until it foams but doesn't brown. Add the 1 whole yellow onion and 3 cloves minced garlic, cooking for 5-6 minutes until softened and translucent. This step builds flavor—don't rush it. You'll see the onion turn pale and sweet, which means it's ready for the next ingredients.
Whisk in the ½ cup all-purpose flour and cook for 1-2 minutes until it forms a smooth paste. This is called a roux, and it's the secret to that velvety texture. Slowly pour in the 1½ cups heavy cream while whisking constantly to prevent lumps. Add the 1 tablespoon Dijon mustard and 1 cup vegetable stock, whisking until everything is fully combined. The mixture should be smooth and thick enough to coat the back of a spoon.
Layer and Assemble for Ultimate Texture
Preheat your oven to 375°F. Generously butter a 9x13-inch baking dish—this prevents sticking and helps create that crispy top later. Spread half of the seasoned bean mixture evenly in the bottom of the dish. Then, sprinkle half of the 2 cups sharp chedddar cheese and 1 cup gruyère cheese over the beans. Repeat with the remaining beans and cheese, finishing with another layer of cheese on top.
Here's the thing—don't skimp on the cheese. The top layer needs to be thick enough to brown beautifully. The sharp chedddar gives that tangy punch, while the gruyère adds nutty depth. The cheese layers will melt into the beans, creating that luscious, creamy center we're after.
Bake to Golden Perfection with Crispy Top
Bake uncovered for 35-40 minutes until the top is deep golden brown and the edges are bubbling. The cheese should be bubbling and pulling away slightly from the sides of the dish. This is your signal that it's developing that beautiful crust. If it's browning too quickly, tent loosely with foil for the last 10 minutes to prevent burning.
For that extra-crispy finish, broil for 1-2 minutes at the very end. Watch it closely—you want golden brown, not burnt. The broiler creates that perfect contrast between the crispy top and creamy interior. Let it rest for 10 minutes before serving—this allows the layers to set and makes slicing easier.
Garnish and Serve with Fresh Herb Flourish
Remove the 2 sprigs fresh thyme leaves and finely chop them. Sprinkle them over the top of the gratin just before serving. The bright herbal note cuts through the richness of the cheese and beans. Serve warm with crusty bread to soak up every last bit of that creamy goodness. Each bite should deliver that perfect combination of crispy, cheesy top and velvety bean center.
Pro tip: If you're making this ahead, assemble the gratin and refrigerate it overnight. Then bake it straight from the fridge at 350°F for about 50-55 minutes, adding the broil at the end. The flavors meld even better after resting!
Pro Tips For Making Bean Gratin
- Drain. Then Rinse.: Cannellini beans straight from a can taste like they’ve been swimming in their own brine. After draining, give them a quick cold-water rinse—especially if you’re using them for a creamy dish like gratin. This cuts the metallic tang that can make your sauce taste flat later.
- Make the roux fast.: Melt 2 tablespoons of butter in your baking dish (yes, the one for the gratin) over medium heat, then whisk in 2 tablespoons flour. Cook for exactly 1 minute—no longer, or you’ll get that burnt-nutty flavor no one wants. Keep the heat steady; rushing it here ruins the creamy texture.
- Don’t skip the mustard.: That Dijon isn’t just for flavor—it balances the richness of the cream and butter. Mix it into the sauce before adding the beans, and let it sit for 5 minutes. This lets the mustard’s sharpness mellow out, so your gratin tastes smooth, not tangy.
- Bake uncovered first.: Start the gratin under the broiler for 3–4 minutes, lid off, to get a deep golden crust on top. Then cover with foil and finish baking at 375°F. This two-step trick prevents a soggy top while keeping the beans tender. (I learned this after one very sad, watery batch.)
Flavor customization for these flavors
Spicy Kick
Add 1-2 teaspoons of hot sauce (like Cholula or Tabasco) directly to the beans before layering, or sprinkle ½ teaspoon cayenne pepper over the top cheese layer. For a smoky heat, mix 1 teaspoon smoked paprika into the béchamel sauce.
I love adding ½ cup diced jalapeños to the bean layer for a fresh, fiery bite that contrasts beautifully with the creamy cheese. 🌶️
Herb Infusions
Swap the thyme garnish for fresh rosemary or sage leaves—chop 2 sprigs and sprinkle over the top before baking. For a Mediterranean twist, add 1 teaspoon dried oregano to the béchamel or ½ teaspoon lemon zest to the beans.
I once made a version with fresh basil and a drizzle of pesto—it was a game-changer for summer dinners.
Umami Boost
Enhance the savory depth by adding 1 tablespoon soy sauce to the béchamel or sprinkling ½ teaspoon miso paste over the cheese layers. For a meaty flavor without meat, stir ½ cup finely chopped mushrooms into the beans or add 1 tablespoon nutritional yeast to the top cheese layer.
I’ve also had great success with 1 teaspoon fish sauce in the béchamel for an extra umami punch.
Sweet & Tangy
Balance the richness with 1 tablespoon maple syrup or 1 teaspoon honey stirred into the béchamel. For a tangy twist, add 1 tablespoon apple cider vinegar to the beans or top with ¼ cup caramelized onions before baking.
I once added ½ cup diced apples to the bean layer—it added a surprising sweetness that cut through the cheese beautifully.
Vegan Adaptations
Replace the heavy cream with 1½ cups full-fat coconut milk (use the thick part) and the butter with ½ cup vegan butter or olive oil. Use vegan sharp cheddar (like Violife) and vegan Gruyère (like Miyoko’s).
For extra creaminess, blend ½ cup cashews with ½ cup water and add to the béchamel. The texture stays rich, and the flavor holds up perfectly. 🌱
Protein Additions
For a heartier dish, fold 1 cup cooked bacon bits into the beans or top with ½ cup crumbled pancetta. Add 1 cup shredded rotisserie chicken to the bean layer for a protein-packed twist.
I’ve also made a version with ½ cup cooked chorizo, which adds a smoky, spicy kick that pairs wonderfully with the creamy beans.
Nutrition facts
Frequently asked questions about bean gratin
Can I use dried beans instead of canned?
For dried beans, soak them overnight, then simmer until tender (1-1.5 hours). Drain well and mash about one-third before layering. The texture will be slightly firmer but equally delicious. Just add ½ teaspoon baking soda to the cooking water to soften them faster.
Why did my cheese crust turn rubbery instead of crispy?
This usually happens when the gratin bakes too slowly or the cheese layers aren't thick enough. Always bake at 375°F and finish with 1-2 minutes under the broiler. For extra crispiness, sprinkle ½ teaspoon cornstarch over the cheese before baking—it creates a lighter, crunchier crust.
What's the best way to reheat leftovers?
For perfect texture, cover loosely with foil and reheat at 350°F for 15-20 minutes until bubbly. Add a splash of milk or cream to the top before reheating to restore creaminess. Never microwave—it makes the cheese soggy. The gratin reheats best when slightly undercooked from the fridge.
Can I make this ahead of time?
Yes! Assemble the gratin up to 24 hours ahead and refrigerate. Bake straight from the fridge at 350°F for 50-55 minutes, adding the broiler at the end. The flavors actually deepen after resting. For make-ahead convenience, pre-shred all cheeses and store them in the fridge until ready to layer.
What's the secret to the creamiest texture?
The béchamel is key! Whisk constantly when adding liquids to avoid lumps, and cook until thick enough to coat the back of a spoon. For extra creaminess, stir 1 tablespoon cold butter into the finished sauce. Also, don't skip the ¼ teaspoon nutmeg—it enhances the creamy flavor profile dramatically.
