iptables resets when server reboots
This is the default behavior.
You may want to take a look at the package iptables-persistent
to automatically set iptables rules at startup from a configuration file.
On Ubuntu 16.04:
sudo apt-get install iptables-persistent
After that, run next commands every time you want save iptables changes permanently:
sudo netfilter-persistent save
sudo netfilter-persistent reload