The 42-year-old, who is currently the head coach of Leicester Tigers, also revealed that he is "hugely encouraged by the hunger within the province".
O'Connor told Sky Sports News: "I am delighted to join Leinster. The playing staff, coaching team and facilities are first class and I have been hugely encouraged by the hunger within the province to push on despite enjoying an unprecedented period of success on the field in recent years.
"I look forward to working with the province's established and burgeoning talent from the renowned Leinster Academy and I am also pleased to work with the current coaching team who have played such a key part in the province's success over the last four years.
"At this time my focus remains with Leicester, but I would like to thank the Leinster board for this vote of confidence and my family and I are hugely excited about starting this new chapter in our lives."
O'Connor will take charge on July 1.