Sunrise at Machu Picchu is pretty stunning (just make sure it won't be an overcast day)
Machu Picchu opens at 530am so you have plenty of time to find the best spot to see sunrise. It also wasn't super busy at this hour. While a lot of people do want to see sunrise, I think this is before organized tours start showing up
We spent the night at Aguas Calientes, the town at the foot of Machu Picchu. This is probably the only way to see sunrise if you don't want to do the Inca trail.
There was a shuttle bus from Aguas Calientes that we took up to Macchu Picchu. Our bus was at 5am but I think the bus schedule may have changed so you should double check at the ticket office. Either way there will be buses that go up in time for the sunrise. To make sure you have a spot on the bus, I recommend getting the ticket the day before you actually want to go up. Here's where the bus stop (and where you can get the tickets) is:
Try to get to the bus station early! We got there around 30 minutes before the scheduled departure and it got pretty busy after us
You'll make it to Machu Picchu in time, but there will likely be some hikers waiting at the gate before you. These guys start climbing at like 3am. Hiking fromAguas Calientes is the another option if you don't want to spend $10 (US) on the bus