Moist Pineapple Coconut Cake with Cream Cheese Frosting
This pineapple coconut cake is soft, tender, and driven by real tropical flavor. Crushed pineapple keeps it incredibly moist, while shredded coconut adds a gentle chew in every slice.

A tangy cream cheese frosting cuts through the sweetness and ties the whole thing together. It all comes together in one bowl, so you can make it on a Tuesday and still serve it proudly at a weekend gathering.
Why This Cake Always Works
I keep this cake in my back pocket because it’s nearly impossible to dry out. The crushed pineapple does all the heavy lifting, so even if you bake it a minute too long, the crumb stays velvety.
The coconut isn’t just a garnish here. It goes right into the batter and toasts lightly as the cake bakes, which gives the edges a subtle nuttiness that balances the tangy frosting.
Ingredients

- 1 can (8 oz) crushed pineapple, undrained: the entire contents go in—juice and all, nothing wasted
- 1½ cups all-purpose flour: spooned and leveled, not scooped directly with the cup
- 1 cup granulated sugar: plain white sugar keeps the flavor bright
- ½ cup vegetable oil: any neutral oil works; melted coconut oil is nice too
- 2 large eggs: at room temperature so they blend easily
- 1 tsp vanilla extract: use the real stuff if you have it
- ½ tsp baking soda: helps the cake rise around all that moisture
- ½ tsp baking powder: extra lift, just in case
- ¼ tsp salt: balances the sweetness
- ½ cup sweetened shredded coconut: the kind sold in the baking aisle
For the Frosting
- 4 oz cream cheese, softened: full-fat block, not the tub style
- 2 tbsp unsalted butter, softened: pulls the frosting together
- 1 cup powdered sugar: sifted if it’s lumpy
- ½ tsp vanilla extract
- Pinch of salt: wakes up the tang
Variations / Substitutions
- Unsweetened coconut: swap in unsweetened shredded coconut; the cake will be less sweet, so you might want an extra tablespoon of sugar in the batter.
- Dairy-free: use a plant-based cream cheese alternative and vegan butter for the frosting. The cake itself contains no dairy if you use oil.
- Add crunch: fold ½ cup chopped toasted macadamia nuts into the batter before baking.
- Cupcakes: divide the batter into a 12-cup muffin tin lined with papers and bake 18–22 minutes; the yield and frosting amount stay the same.
- Toasted coconut top: before frosting, spread ½ cup extra shredded coconut on a dry pan and toast over medium heat until golden, then sprinkle over the finished cake.
If you like this one, you’ll probably also enjoy Tropical Carrot Cake.
How to Make Pineapple Coconut Cake
Step 1: Mix the Batter

Set your oven to 350°F (175°C) and grease a 9-inch round cake pan, then line the bottom with parchment for extra insurance. In a large bowl, whisk together the 1½ cups flour, 1 cup sugar, ½ tsp baking soda, ½ tsp baking powder, and ¼ tsp salt until no lumps remain. In a separate medium bowl, stir the ½ cup oil, 2 eggs, 1 tsp vanilla, the full can of crushed pineapple with its juice, and the ½ cup shredded coconut until everything is evenly combined. Pour the wet mixture into the dry and fold with a spatula just until no streaks of flour are visible.
The batter will look thick and a little lumpy from the pineapple, with shreds of coconut suspended throughout. Overmixing at this point will make the cake tough, so stop as soon as the flour disappears.
Step 2: Bake the Cake

Scrape the batter into the prepared pan and smooth the top lightly with the spatula. Bake on the center rack for 30 to 35 minutes, until the top springs back when you press it gently and a toothpick inserted in the center comes out with just a few moist crumbs clinging. If the top browns too fast before the center is done, tent the pan loosely with foil for the last 5 to 10 minutes.
The cake will pull away from the sides of the pan and the kitchen will smell warm and sweet. Let it cool in the pan for 10 minutes, then turn it out onto a wire rack to cool completely before you reach for the frosting.
Step 3: Make the Frosting

In a stand mixer or with a hand mixer, beat the 4 oz softened cream cheese and 2 tbsp softened butter together on medium speed until smooth and combined, about 1 minute. Scrape down the bowl, add 1 cup powdered sugar, ½ tsp vanilla, and a pinch of salt, then beat on low until the sugar incorporates. Increase the speed to medium and whip for 2 minutes, until the frosting is light and spreadable.
If the frosting feels too stiff to spread easily, a teaspoon of milk or pineapple juice loosens it right up. Taste and add a tiny extra pinch of salt if you want the tang to come through more.
Step 4: Frost and Slice

Once the cake is fully cool, set it on a serving plate and pile the frosting on top. Use an offset spatula or the back of a spoon to spread it to the edges, swirling as you go. If you toasted extra coconut, scatter it over the frosting while it’s still sticky so it clings well.
Slice into wedges and serve at room temperature. The crumb stays moist for days, and the frosting sets just enough to hold a clean cut.
Tips for a Tender Crumb
- Let the cream cheese and butter sit out for at least 30 minutes before you make the frosting. Cold cream cheese leaves small lumps that never fully smooth out.
- When measuring flour, spoon it into the cup then level it with a knife. Dipping the cup straight into the bag packs in too much flour and dries out the cake.
- If you only have an 8-inch square pan, the batter will be a little taller, so add about 5 minutes to the bake and check with a toothpick often.
- The cake tastes even better the next day, so it’s a solid make-ahead dessert. The pineapple has time to settle into the crumb and everything becomes more tender.
Bake times by pan:
| Pan Style | Size | Bake Time |
|---|---|---|
| Round cake pan | 9-inch | 30–35 mins |
| Square pan | 8-inch | 25–30 mins |
| Muffin tin | 12 standard cups | 18–22 mins |
Storing Leftovers
Cover the frosted cake tightly and refrigerate it for up to 5 days; the cool temperature keeps the cream cheese frosting firm. Bring slices to room temperature for about 15 minutes before eating so the crumb softens back up. To freeze, wrap the unfrosted cake layer in plastic then foil and freeze for up to 2 months—thaw overnight in the fridge and frost fresh.
Frequently Asked Questions
Can I use fresh pineapple instead of canned?
Yes, but fresh pineapple contains an enzyme that can break down the cake’s structure, so you must cook it first. Simmer 1 cup finely chopped fresh pineapple with 2 tablespoons of water and 1 tablespoon of sugar for 5 minutes, then cool and use it undrained just like the canned.
Why did my cake sink in the middle?
A sink usually means the batter was overmixed or the cake was underbaked. Fold the wet and dry ingredients just until the flour disappears, and make sure the toothpick really comes out clean before pulling it from the oven.
Can I make this cake gluten-free?
Absolutely. Swap the all-purpose flour for a 1:1 gluten-free baking blend that already contains xanthan gum. The texture will be slightly more tender but still moist, and the bake time stays about the same.
Can I skip the frosting?
You can, though the tang balances the sweet, fruity crumb. For a lighter finish, dust the cooled cake with powdered sugar or serve it with a dollop of whipped cream and fresh pineapple on the side.

Pineapple Coconut Cake Recipe
Ingredients
Method
- Preheat oven to 350°F (175°C) and grease a 9-inch round cake pan. Whisk flour, sugar, baking soda, baking powder, and salt in a large bowl. In another bowl, stir oil, eggs, vanilla, crushed pineapple with its juice, and shredded coconut. Fold wet into dry just until combined.
- Scrape batter into the prepared pan and bake 30–35 minutes, until a toothpick comes out with moist crumbs. Cool in pan 10 minutes, then turn out onto a wire rack to cool completely.
- Beat cream cheese and butter until smooth. Add powdered sugar, vanilla, and a pinch of salt; beat on low to incorporate, then on medium for 2 minutes until light and spreadable.
- Spread frosting over the completely cooled cake. Top with toasted coconut if you like, slice, and serve at room temperature.
