Preheat your oven to 350°F (175°C) and line a cupcake pan with liners.
In a large mixing bowl, combine the flour, sugar, cocoa powder, baking powder, baking soda, and salt.
Add the milk, vegetable oil, and vanilla extract to the dry ingredients and mix until well combined.
Carefully add the boiling water to the batter and mix until smooth.
Pour the batter into the cupcake liners, filling each about ⅔ full.
Bake in the preheated oven for 20-25 minutes, or until a toothpick inserted into the center comes out clean.
While the cupcakes are baking, prepare the frosting. In a mixing bowl, beat the softened butter until creamy.
Gradually add the powdered sugar, milk, and vanilla extract, beating until smooth and fluffy.
Once the cupcakes are cool, frost them with the prepared frosting and sprinkle with shredded coconut.