Preheat oven to 350ºF. Line two 6-inch round cake pans with parchment paper. Lightly grease and set aside.
Whisk together flour, cocoa powder, espresso powder, baking powder, baking soda, and salt. Set aside.
In the bowl of a stand mixer fitted with a paddle attachment, mix together coconut oil, sugar, eggs, and vanilla until combined. On low speed, alternate adding dry flour mixture and milk. Add about 1/3 of flour mixture, followed with half of the milk. Add another 1/3 of flour and remaining milk. Scrape down bowl as needed to ensure thorough mixing. Add sour cream and remaining flour. Mix until combined and there are no longer any streaks of dry flour.
Divide batter between prepared cake pans. Level batter. Bake for 28-30 minutes until toothpick inserted in center of cake comes out clean. Allow cake to cool in pan for 3-5 minutes before unmolding. Allow cakes to cool to room temperature on wire rack.