The home side made a bright start as Rhys Patchell got the opening try of the night on the board inside the first minute.
Josh Navidi kept Cardiff in the match at half time though, before the visiting side were reduced to 14 men with Bismarck du Plessis sent to the sin bin earlier in the second half, setting up Lloyd Williams for the Blues' third try of the night.
Things got worse for Montpellier though as an offence in the build-up to Williams's try by Robins Tchale-Watchou saw the replacement shown the yellow card, leaving the team two players short.
Montpellier survived without conceding any more points while the two players were off the pitch, but Alex Cuthbert secured the bonus point for Cardiff shortly after, intercepting the ball before running back from inside his own half.
Gethin Jenkins set up Navidi for his second soon after, all but securing the win for the home side, but Montpellier did close the gap late on, as Charles Geli battled over in the final couple of minutes.