Castro's pact guarantees him $7 million and can be worth up to $9 million through a performance bonus, reports Jeff Passan of ESPN.
The 10-year veteran began his major-league career with six seasons in Houston. He played for the Los Angeles Angels and San Diego Padres in 2020.
Castro owns a career .230/.312/.390 slash line with 88 homers and 301 RBIs over 852 games.
The 33-year-old will likely challenge incumbent backstop Martin Maldonado for the Astros' starting job.