Karl Anderson, 29, pleaded guilty to racially aggravated common assault after Sterling was attacked as he arrived at City’s Etihad complex before Saturday’s match against Tottenham Hotspur.
Salford Magistrates’ Court heard Anderson had kicked and shouted racial abuse at the 23-year-old England international.
Anderson has 25 previous convictions for 37 offences, including throwing a flare at a police officer during a football match.
The court was shown CCTV of Anderson driving his van alongside Sterling’s vehicle as the player waited to enter the training ground on Saturday.
Both men then got out of their vehicles and Anderson walked towards Sterling.
Carl Miles, prosecuting, said Anderson, who had been in the vehicle with his partner, began shouting racial abuse at Sterling.
Miles said: “He sets out kicking Mr Sterling to the legs on four occasions.”
The court heard Sterling’s left hamstring was sore after the attack but he did not suffer serious injuries.
In a victim personal statement, which was read to the court, the footballer said he had been “completely shocked” by the incident.
He said: “I didn’t think this type of behaviour still happened in this country in this day and age.”
Sentencing, chairman of the bench Diana Webb-Hobson said: “This was an entirely unprovoked attack. You stopped your car and you got out.
“The personal statement was very moving, we find injury was sustained.”
Magistrates also ordered Anderson to pay £100 compensation and £115 victim surcharge.