Anderson will take over at Hatrick Park from John Andrews who has ironically moved to Dungannon, the club Anderson led to the Division One title in 2001.
The 52-year-old ex-lock, whose 27th and final Ireland cap came against Scotland in 1990, is currently on a rugby tour with Holywood school Sullivan Upper in New Zealand and will start with Rainey next month.
He is a full-time PE teacher at Sullivan Upper and previously taught at Rainey Endowed, where his son Thomas, the Dungannon and Ireland Under-20 flanker, was a pupil.
Anderson has been assistant coach with Leinster and Scotland in recent years, and had a spell with Ballynahinch during the 2005/06 season.
Rainey had a season to remember in 2005/06 when they won promotion to the AIB League and claimed the inaugural AIB Junior Cup, beating Youghal 27-5 in the final at Lansdowne Road.
The men from Magherafelt finished a very credible seventh in their first season in Division Three and are targeting a top-four finish next term.
Rainey chairman Arnie McLean said: "We are absolutely delighted to get someone of Willie's experience. He was miles better qualified than anyone else who applied and he lives just three miles from the club.
"It was a massive blow to lose John Andrews but we have a good young squad and there is no better man than Willie Anderson to take them on to the next stage. He will be a hell of an asset to us."
The Derry club's senior teams are back in pre-season training tomorrow night.