Is there a local train from Milan Centrale to Malpensa.
If there is, can anyone tell me how long the trip is?
For an early morning flight is it better to stay in Milan or are there hotels near the airport?
Yes
Malpensa Express from either Centrale or Cadorna
Runs about every 30 min-takes about an hour
A bit shorter journey from Cadorna
https://www.trenitalia.com/content/tcom/en.html
We stayed in Milan and took train in am for an 11 ish flight arriving at MXP about 8
Yes there are hotels at the airport
A forum search will bring some up
The first train from Cadorna station is at 4:27am, arriving at 5:10am at MXP terminal 1. As you are required to be at the airport three hours before an intercontinental flight, it means that you can take the train if your flight leaves after 8am. - if you leave from Centrale station the first train is at 5.25am, arriving at 6:16am so you earliest possible flight would be at 9am.
As a general rule, MXP is very distant from downtown, so very early flights are impractical.
If you are flying to somewhere else in Europe as your first leg or final destination, then two hours before the flight is sufficient.
It is also helpful to know which terminal you need.
There are also bus shuttles from Centrale to Malpensa. We've taken one of these early in the morning and it worked well for us: