The entire route can be walked. It is over 4 kilometres (over 2.5 miles) long. I recommend comfortable shoes and plenty of breaks for refreshments and excellent Czech beer :-)
The Prague Castle grounds open at 6 a.m. Indoor buildings usually at 9 am. You will therefore have the opportunity to explore the surroundings of the cathedral without the crowds of tourists.
As the first indoor object, go to Golden Lane right at 9 am.
You can buy tickets at the door (from 9am, the ticket office is opposite the Cathedral) or Guided tour ticket in advance - the link is in the Prague Castle tab.