The 36-year-old will join fellow veteran winger Arjen Robben in departing the Allianz Arena in June and a testimonial match will be held for both players in 2020.
"When I came to Bayern, it was a dream come true. It won't be easy to say goodbye, but we must never forget what we've achieved together," said Ribery.
"I won more than 20 trophies and, of course, I hope we can add another Bundesliga title and the DFB-Pokal at the end of this season. That would be great for me personally and my family and, of course, for the fans too.
"When I joined Bayern the relationship was immediately great. I always want to do special things for the fans when I'm on the pitch. I always want to play well because it feels so good to wear this jersey. I always wanted to get the jersey really wet for my club.
"The fans know I have heart and that I'm honest, we always had a good relationship. It's incredible to think I was here for 12 years and it's tough for me and the fans, but we cannot forget all the things we experienced together."
Chairman Karl-Heinz Rummenigge added: "Franck and Arjen are great players. FC Bayern owes a lot to both of them and we will give them a wonderful and emotional farewell.
"They've helped shape FC Bayern's most successful decade with fantastic football."
Bayern are one win away from wrapping up yet another Bundesliga title after hauling themselves back into the ascendency following a season which they have mostly trailed rivals Borussia Dortmund.
Victory against RB Leipzig next weekend will confirm a seventh successive title success for the champions, regardless of how second-place Dortmund fare in their final two outings.