In this article I review the fundamentals of solar-dynamo theory. I describe both historical and contemporary observations of the solar magnetic field before outlining why it is believed that the solar field is maintained by a hydromagnetic dynamo. Having explained the basic dynamo process and applications of the theory to the Sun, I shall conclude by speculating on future directions for the theory.