Berry wrote in a petition last month that she was "extremely frightened" of Richard A. Franco.
Los Angeles Superior Court Judge Carol Boas Goodson granted Berry the order on Monday without requiring the actress to attend a hearing.
Franco was arrested after scaling the wall of her house on July 11. He is accused of entering Berry's property three times over a three-day period in July, including an incident in which the actress says he nearly followed her into her home.
He faces two felonies stemming from the three incidents.
Franco is required to stay 100 yards from the actress and her 3-year-old daughter.
The Associated Press contributed to this report.