The Braves traded Gattis and James Hoyt to the Houston Astros for Mike Foltynewicz, Andrew Thurman, and Rio Ruiz on January 14, 2015. Gattis said he was a fan of the Texas Rangers as a youth and not the Astros, but also said it is a "good environment" in Houston. During the 2015 season, Gattis hit 27 home runs in a career-high 604 plate appearances, spending most of the season as the Astros' primary designated hitter. He also recorded 11 triples, despite entering the 2015 season with one career triple and being the second-slowest player in baseball, behind David Ortiz of the Boston Red Sox.
Gattis lost approximately 20 pounds (9.1 kg) during the 2015–16 offseason by focusing on his nutrition and working with a personal trainer. He started only 11 games in left field in 2015, none at catcher, and 136 at designated hitter. The Astros planned to play Gattis in the field more for the 2016 season, including left field, first base, and his original position of catcher. Eligible for salary arbitration, the Astros and Gattis agreed on a one-year contract on February 16, 2016. The contract will pay Gattis $3.3 million for the 2016 season, with a $5.2 million club option for the 2017 season. Gattis underwent hernia surgery on February 9, 2016, causing him to miss spring training. He was activated in April 2016, having missed seven regular season games due to the operation. In his first 20 games of 2016, he batted .203 with a home run and seven RBIs. He was optioned to the Corpus Christi Hooks of the Class AA Texas League on May 7, 2016, in order to transition back into a catcher. He was recalled on May 18, and started at catcher the next day.