To set up email forwarding, you will need to install a mail transfer agent (MTA) first such as Postfix. Check out How To Install and Setup Postfix on Ubuntu 14.04 | DigitalOcean.
Once you've done that, add an alias so that all emails are forwarded to your gmail email address:
/etc/postfix/virtual in your favorite editor:
sudo nano /etc/postfix/virtual
Add the following line at the bottom:
# Forward everything under @domain.com
# Forward specific email addresses
Then, apply the changes:
sudo service postfix restart
Postfix is one of the most popular open source mail delivery agents (MTA) in the world. In this guide, we will demonstrate how to install and configure a simple Postfix setup on an Ubuntu 14.04 server.