The railroad received its charter in 1846, with some backing from the Eastern Railroad, and by the beginning of 1847, the first 2 miles of track were completed from Salem to Peabody (then called South Danvers).