Fluffy Coconut Cake With Pineapple Filling
This coconut cake with pineapple filling is the kind of dessert that makes an ordinary Tuesday feel worth celebrating. The cake layers are tender and fragrant with coconut milk, and the sweet-tart filling cuts through the richness perfectly.

It feels special without being fussy. If you can stir a saucepan and beat a cake batter, you can pull this off.
What Makes This Coconut Cake So Good
Full-fat coconut milk in the batter gives the crumb a plush, almost velvety texture that stays moist for days. The coconut flavor is gentle and real, never like a bottled extract.
The pineapple filling comes together on the stove in about five minutes. It thickens to a glossy, jammy consistency that spreads evenly and stays put between the layers. It is sweet, a little tangy, and so much brighter than anything from a can.
Ingredients

- 2 cups all-purpose flour: spooned and leveled for the right crumb
- 1 tsp baking powder
- 1/2 tsp baking soda
- 1/2 tsp salt
- 1 cup unsalted butter, softened: gives the cake its rich tenderness
- 1 1/2 cups granulated sugar
- 3 large eggs, at room temperature: they blend in more smoothly
- 2 tsp vanilla extract
- 1/2 tsp coconut extract: optional, but deepens the coconut note
- 1 cup canned full-fat coconut milk, stirred well: use the full-fat kind, not light
- 1 can (20 oz) crushed pineapple in juice: you will drain and reserve the juice
- 1/2 cup granulated sugar: for the filling
- 3 tbsp cornstarch: thickens the filling to a spreadable jam
- 1 tbsp unsalted butter: stirred in at the end for gloss
- 1 tsp lemon juice: brightens the pineapple
- 8 oz cream cheese, softened: use the block kind, not the spread
- 1/2 cup unsalted butter, softened: for the frosting
- 3 to 4 cups powdered sugar: adjusts sweetness and stiffness
- 2 tbsp canned coconut milk: to thin the frosting
- 1 tsp vanilla extract
- 1 cup sweetened shredded coconut: for decorating the frosted cake
Variations / Substitutions
- Swap pineapple for mango: use frozen mango chunks, cook them down the same way, and mash lightly if needed.
- Make it dairy-free: use vegan butter sticks and dairy-free cream cheese, or frost with a thick coconut whipped cream.
- Add a rum note: brush the cooled cake layers with a tablespoon of coconut rum before spreading the filling.
- Toast the coconut frosting: fold 1/2 cup of toasted shredded coconut into the frosting for extra texture.
If you like this one, our Banana Cake with Cream Cheese Frosting is another crowd-pleaser.
How to Make Coconut Cake With Pineapple Filling
Step 1: Cook the Pineapple Filling

Drain the can of crushed pineapple and reserve the juice in a measuring cup. You should have about 1/2 cup. Stir the drained pineapple, that reserved juice, 1/2 cup sugar, and 3 tablespoons cornstarch together in a small saucepan until the cornstarch dissolves completely. Place the pan over medium heat and bring it to a simmer, stirring often.
Cook for 5 to 7 minutes, until the mixture thickens until it looks glossy and jammy. It will still be a little loose while hot, but it sets up as it cools. Stir in the tablespoon of butter and the lemon juice off the heat, then let the filling cool completely. Spreading hot filling on a cake will melt your frosting.
Step 2: Mix the Cake Batter

Preheat your oven to 350°F (175°C). Grease two 8-inch round cake pans and line the bottoms with parchment paper. In a medium bowl, whisk together the 2 cups flour, baking powder, baking soda, and salt. In a large bowl, beat the 1 cup softened butter and 1 1/2 cups sugar on medium speed until light and fluffy, about 3 minutes. Add the eggs one at a time, beating well after each, then mix in the 2 teaspoons vanilla and the coconut extract if you are using it.
With the mixer on low, add the flour mixture in three parts, alternating with the cup of coconut milk, beginning and ending with the flour. Stop mixing as soon as the last streak of flour disappears. The batter will be thick and creamy, with no trace of dry pockets.
Step 3: Bake the Cake Layers

Divide the batter evenly between the two pans and smooth the tops. Bake for 28 to 32 minutes, rotating the pans halfway through so they cook evenly.
The layers are done when a toothpick inserted in the center comes out clean and the tops spring back when you press them lightly. Cool the cakes in the pans for 10 minutes, then turn them out onto a wire rack and let them cool completely. Even a little warmth will cause the frosting to slide.
Step 4: Whip the Coconut Frosting

Before you assemble the cake, make the frosting. Beat the 8 ounces cream cheese and 1/2 cup butter together until smooth and fluffy, about 2 minutes. Add the powdered sugar a cup at a time, then pour in the 2 tablespoons coconut milk and the teaspoon of vanilla.
Whip on high for another 2 minutes until the frosting is light and spreadable. It should hold soft peaks and taste mildly of coconut. If it feels too stiff, add a splash more coconut milk until it reaches a consistency that is easy to spread but won’t drip.
Step 5: Assemble and Frost the Cake

Place one completely cooled cake layer on a serving plate. Spread the cooled pineapple filling over the top, leaving a border about half an inch from the edge so nothing oozes out when you add the second layer. Set the second cake layer on top, flat side up.
Cover the whole cake with the coconut frosting, starting with the top and working your way around the sides. Generously sprinkle the cup of shredded coconut all over, pressing some gently into the sides. Slice and serve right away, or chill for 30 minutes first so the frosting sets and you get clean cuts.
Tips for the Best Coconut Layer Cake
- Use full-fat canned coconut milk, not the carton kind meant for drinking. The richness makes a real difference in both crumb and flavor.
- Cool the filling fast by spreading it onto a plate and popping it in the fridge while the cake bakes. This gets you from oven to frosted cake without a long wait.
- If your frosting feels too thick, add a tiny splash of coconut milk (no more than a teaspoon at a time) until it is easy to spread but still holds its shape.
- Toast the shredded coconut in a dry pan for a few minutes before sprinkling it on. It adds a nutty, crisp bite that stale coconut just cannot give.
- Don’t overmix the batter after the flour goes in. Stir until just combined and no white streaks remain.
Bake times shift a little depending on your pan size. Check early and use the toothpick test.
| Pan Size | Time |
|---|---|
| 8-inch (20 cm) rounds | 28-32 minutes |
| 9-inch (23 cm) rounds | 24-28 minutes |
Keeping the Cake Fresh
Refrigerate the frosted cake in a covered container for up to 4 days. Removing it from the fridge about 30 minutes before serving lets the crumb soften back to its ideal tender texture. The cake keeps well overnight and often tastes even better the next day.
Frequently Asked Questions
Can I use fresh pineapple for the filling?
Yes. Chop it finely and cook it a few minutes longer, until the fruit softens and the mixture thickens. Fresh pineapple’s enzyme does not interfere with cornstarch-thickened sauces.
How do I keep the filling from seeping out the sides?
Pipe a sturdy ring of frosting around the outer edge of the bottom cake layer before spooning the filling inside. That barrier holds everything in place.
Can I make this cake a day ahead?
Absolutely. Assemble it, cover, and store in the fridge. The cake stays moist and the flavors settle in beautifully overnight.
Can I freeze the coconut cake?
Yes. Wrap the unfrosted cake layers tightly in plastic and freeze for up to 2 months. Thaw completely before you fill and frost them.

Coconut Cake With Pineapple Filling Recipe
Ingredients
Method
- Cook the filling: combine drained pineapple, reserved juice, 1/2 cup sugar, and cornstarch in a saucepan. Simmer over medium heat, stirring, for 5-7 minutes until thick and jammy. Stir in butter and lemon juice, then cool completely.
- Preheat oven to 350°F (175°C). Grease two 8-inch round cake pans. Beat butter and sugar until fluffy, then add eggs, vanilla, and coconut extract. Alternate adding flour mixture and coconut milk, mixing just until combined. Divide batter evenly.
- Bake for 28-32 minutes, rotating halfway, until a toothpick comes out clean. Cool in pans 10 minutes, then transfer to a rack to cool completely.
- Beat cream cheese and butter for frosting until smooth. Add powdered sugar gradually, then coconut milk and vanilla. Whip until light and spreadable.
- Spread cooled filling on one cake layer, leaving a border. Top with the second layer. Frost top and sides, then cover with shredded coconut. Chill 30 minutes before slicing for clean cuts, if desired.
