The 40-year-old Beltran, a nine-time All-Star with 435 career home runs, made the announcement Monday with a first-person essay on The Players' Tribune.
"I am blessed to have played this game for 20 years," Beltran wrote. "I am blessed to have played for so many great organizations.
"I am blessed to have shared all of my experiences with my wife and my three kids, my family and friends. To have so many loving fans. To have been able to build a school in Puerto Rico and change the lives of so many kids. To have won the Roberto Clemente Award, which is the greatest honor I could have ever received as a ballplayer.
"And I am blessed to be a champion. But now, my time as a player has come to an end."
Beltran played for seven different teams, starting with the Kansas City Royals in 1998. He also played for the New York Mets, St. Louis Cardinals, New York Yankees, Texas Rangers and San Francisco Giants, before making a second stop in Houston for the 2017 season.
Beltran batted .231 with 14 homers and 51 RBIs in 129 games with Houston this season. The Astros signed him to be their primary designated hitter but as the season progressed, his playing time decreased.
For his career, Beltran batted .279 with 2,725 hits, 1,587 RBIs and 1,582 runs scored in 2,586 games.
Beltran told MLB.com he reached the decision to retire sometime over the summer during Houston's memorable run.
"At the beginning of this year, being in Houston while my family was in New York, it was the first time I've been away from my family for months," Beltran said in his first interview since announcing his retirement. "I told (my wife) Jessica I really missed the family and I wanted to be with them, so I was really contemplating retirement after this year. I said, 'Hopefully we can get to the World Series and win the World Series, so I can go home on a happy note.'
"When the family came to Houston for the summer, I told Jessica, 'This will be my last year for sure.' I couldn't be away from my family for such a long time anymore."