It is the 51-year-old’s first job since he was sacked as United manager in April after a 10-month spell in charge.
Moyes replaces Jagoba Arrasate, who was dismissed by Sociedad after a poor run of form which currently sees them lie 15th in La Liga.
The Scot has signed a contract to June 2016 and will take charge for the first time at Deportivo on 22 November.
Sociedad announced the appointment late on Monday in a statement on their website.
“Real Sociedad have reached an agreement with David Moyes,” it read.
“Details about the official presentation of Real Sociedad’s new coach and who will form part of his technical team will be published tomorrow [Tuesday] morning.”
Read more at: BBC Sport