Dinners

Coconut Cream Pie Cake Recipe with Custard Filling

Updated · By Patriot Kitchen

Total timeincludes chilling, rising or resting
4 hr 40 min
Prep
40 min
hands-on
Cook
35 min
oven or stovetop
Serves
12
as written

Jump to recipe Save

Coconut cream pie cake layers a tender coconut cake with a thick vanilla-coconut custard and a whipped cream topping. The custard is the part that makes it a pie-cake hybrid: it needs enough cornstarch to set firmly without turning rubbery, and the cake needs enough fat to stay moist under the custard. This version uses a from-scratch yellow cake base with shredded coconut folded in, then builds the filling on the stovetop so it sets before assembly.

Ingredients

  • For the cake: 2 cups (250 g) all-purpose flour
  • 2 tsp baking powder
  • 1/2 tsp salt
  • 3/4 cup (170 g) unsalted butter, softened
  • 1 1/2 cups (300 g) granulated sugar
  • 3 large eggs, room temperature
  • 1 tsp vanilla extract
  • 1 cup (240 ml) whole milk, room temperature
  • 1 cup (85 g) sweetened shredded coconut, plus more for topping
  • For the custard: 2 cups (480 ml) whole milk
  • 1 cup (240 ml) heavy cream
  • 3/4 cup (150 g) granulated sugar
  • 1/4 cup (32 g) cornstarch
  • 4 large egg yolks
  • 1 tsp vanilla extract
  • 1 cup (85 g) sweetened shredded coconut
  • For the topping: 1 1/2 cups (360 ml) heavy cream
  • 3 tbsp (40 g) powdered sugar
  • 1 tsp vanilla extract
  • 1/2 cup (40 g) toasted coconut flakes for garnish

Instructions

  1. Preheat oven to 350°F (175°C). Grease two 9-inch (23 cm) round cake pans and line bottoms with parchment paper.
  2. In a medium bowl, whisk flour, baking powder, and salt. In a large bowl, beat butter and sugar until light and fluffy, about 3 minutes. Add eggs one at a time, beating well after each, then beat in vanilla.
  3. Add flour mixture in three additions, alternating with milk, starting and ending with flour. Fold in 1 cup (85 g) shredded coconut.
  4. Divide batter between pans. Bake 25-30 minutes, until a toothpick inserted in the center comes out clean. Cool in pans 10 minutes, then turn out onto a wire rack to cool completely.
  5. Make the custard: In a medium saucepan, whisk milk, cream, sugar, cornstarch, and egg yolks until smooth. Cook over medium heat, stirring constantly, until thickened and bubbling, about 8-10 minutes. Remove from heat, stir in vanilla and 1 cup (85 g) coconut. Transfer to a bowl, cover with plastic wrap directly on the surface, and refrigerate until completely chilled, at least 2 hours.
  6. Make the topping: In a chilled bowl, beat cream, powdered sugar, and vanilla until stiff peaks form.
  7. Assemble: Place one cake layer on a serving plate. Spread chilled custard over it, leaving a 1/2-inch (1.25 cm) border. Top with second cake layer. Frost the top and sides with whipped cream. Press toasted coconut onto the sides and sprinkle on top.
  8. Refrigerate at least 1 hour before slicing to let the custard set further.

Why the Custard Can Turn Runny or the Cake Dry

The custard sets because cornstarch gelatinizes at around 203°F (95°C). If you stop cooking before it bubbles, the starch isn’t fully activated and the custard will be loose. Cook it until it visibly bubbles for at least 1 minute, stirring constantly. If it still seems thin after chilling, it wasn’t cooked long enough.

The cake can dry out if overbaked or if you use low-fat milk. Whole milk and butter provide the moisture that keeps the crumb tender. Check for doneness at 25 minutes; if a toothpick has wet crumbs, bake 2-3 minutes more, but no longer than 30 minutes total.

If the custard is too thick and lumpy, you likely added the egg yolks to hot milk too quickly. Temper the yolks by whisking a ladleful of hot milk mixture into them first, then whisk back into the pot. Strain through a fine-mesh sieve before chilling to remove any cooked bits.

Substitutions That Work

  • Swap the whole milk in the cake for buttermilk (same amount). The cake will be slightly more tender and tangy, which pairs well with coconut.
  • Use coconut milk (full-fat, canned) in place of the milk in the custard for a stronger coconut flavor. The custard will be richer and slightly less set; increase cornstarch by 1 tbsp (8 g).
  • Replace the sweetened shredded coconut with unsweetened desiccated coconut. Add 2 tbsp (25 g) extra sugar to the cake batter and 1 tbsp (12 g) to the custard to compensate.
  • For a gluten-free version, substitute a 1:1 gluten-free flour blend for the all-purpose flour. The cake will be slightly more crumbly; handle gently when stacking.
  • For a dairy-free version, use plant-based butter and milk (like oat or almond) in the cake and custard, and a coconut-based whipped topping for the cream. The custard may need an extra 1 tbsp (8 g) cornstarch to set.

How to Store This Cake and How Long It Lasts

Store the assembled cake in the refrigerator, covered loosely with plastic wrap or in a cake carrier, for up to 3 days. The custard and whipped cream are perishable, so never leave the cake at room temperature for more than 2 hours (1 hour if above 90°F/32°C).

You can freeze the unfrosted cake layers for up to 3 months, wrapped tightly in plastic wrap and foil. Thaw overnight in the refrigerator before assembling. The custard can be made 2 days ahead and kept refrigerated; stir well before using. The assembled cake does not freeze well because the custard and cream separate when thawed.

To keep the cake from drying out in the fridge, press plastic wrap directly onto any cut surfaces. The toasted coconut garnish will soften over time; add it just before serving if you want it crunchy.

What If the Custard Is Too Thick or the Cake Sinks?

If the custard is too thick and stiff, you cooked it too long or added too much cornstarch. To rescue it, whisk in 1-2 tbsp (15-30 ml) of warm milk until it loosens. If it’s already chilled, warm it gently over low heat while whisking, then re-chill.

If the cake sinks in the middle after baking, the batter was overmixed, which develops too much gluten and traps air that collapses. Mix just until the flour disappears, and don’t open the oven door during the first 20 minutes of baking. A sunken center can be leveled by trimming the top with a serrated knife before assembly.

If the whipped cream weeps or turns watery, the cream was overbeaten or the cake was assembled too warm. Always chill the cake layers completely before adding the cream, and beat the cream just to stiff peaks—stop as soon as the peaks hold their shape.

Related

Safe minimum internal temperatures follow USDA FSIS; raw-fish guidance follows the U.S. FDA. See our food safety notes.

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