This guide will cover the setting-up of a static IP address on Ubuntu Server 16.04 LTS.
sudo nano /etc/network/interfaces
eth0 section may look something like this:
# The primary network interface auto eth0 iface eth0 inet dhcp
Edit it to look like this (substitute the addresses below with your own):
# The primary network interface auto eth0 iface eth0 inet static address 192.168.200.50 netmask 255.255.255.0 network 192.168.200.0 gateway 192.168.200.1 dns-nameservers 18.104.22.168
Make sure you choose an address outside your network DHCP server’s scope to avoid address conflicts.
Reboot the machine after saving.
sudo shutdown -r now
After the machine reboots, the changes can be verified with