How to save and backup website

Can i save my template and upload when i buy hosting, so i don't have to create it all again? can i save it as a backup and upload done when i decide to get hosting? if so how can i do this?