Cesis is 90 km northeast of Riga on the road to Estonia. The train from Riga takes just over 1.5 hours and is the easiest way to get there; several trains run daily. By car from Riga, take the P3 road north through Sigulda (also worth a stop) and continue to Cesis.
Day trips from Riga are very practical. Staying overnight allows you to see the castle and town at a slower pace and to walk into the Gauja Valley forest in the evening when the day visitors have gone.