Global positioning system (GPS) is the most widely adopted localization technique for satellites in low earth orbits (LEOs). To enable many state-of-the-art applications on satellites, the exact position of the satellites is necessary. With the increasing demand for small satellites, the need for a low-power GPS for satellites is also increasing. However, building low-power GPS receivers for small satellites poses significant challenges, mainly due to the high speeds (~7.8 km/s) of satellites and low available energy. While duty cycling the receiver is a possible solution, the high relative Doppler shift among the GPS satellites and the small satellite contributes to an increase in Time to First Fix (TTFF), which negatively impacts energy consumption. Further, if the satellite tumbles, the GPS receiver may not be able to receive signals properly from the GPS satellites, thus leading to an even longer TTFF. In the worst case, the situation may result in no GPS fix due to disorientation of the receiver antenna. In this work, we elucidate the design of a low-cost, low-power GPS receiver for small satellites. We also propose an energy optimization algorithm to improve the TTFF. With the extensive evaluation of our GPS receiver on an operational nanosatellite, we show that up to 96.16% of energy savings can be achieved using our algorithm without significantly compromising (~10 m) the positioning accuracy.