That is a very big and open question.
If you have already configured a mail server that sends email to your gmail account using the mail command then you only have to update:
Just add your email address as the alias for root (Or whatever user you want) and messages for that user get pinged over.
Remember to read the comments in the various files and man pages for information.
If you have not yet got that working then depending on your server set-up etc... you have to configure your MTA respectively. Chances are you just need to tell it to point all outbound email to a specific email server and it takes care of the rest of it for you.
If you need more specific help can you give more details about your set-up and configuration.