Chamakh, who was released by Crystal Palace at the end of last season, had previously attracted interest from Bluebirds boss Neil Warnock.
The Moroccan, 32, has signed a deal until January to reunite with Warnock, who managed him at Selhurst Park.
"I'm so happy to be here and work with the manager again," Chamakh said. "I'm happy and proud to work with him here."
Chamakh joins Sol Bamba and Junior Hoilett as Warnock bolsters a squad second bottom of the Championship.
The ex-Bordeaux striker thinks Cardiff can improve quickly under their new manager.
"Cardiff are a side that should be on top and I think we can improve going forward," he said.
"I'm looking forward to meeting with my new team-mates and getting started. I can't wait to score for my new team."
Warnock added: "We've signed Marouane on a short-term deal until January to assess his fitness.
"He's a versatile player with pedigree and somebody who impressed me during my time at Crystal Palace."
Chamakh, who has made 65 international appearances for Morocco, had a trial this summer with West Brom.
Bamba, 31, has signed until 2018 and joins ex-QPR winger Hoilett at the Bluebirds.
Former Arsenal striker Marouane Chamakh has become Cardiff's City third free-transfer signing in the past 24 hours.