If the Ubuntu Server installer has set your server to use DHCP, you will want to change it to a static IP address so that people can actually use it.
First, open the file /etc/network/interfaces using the following command :
sudo nano /etc/network/interfaces
It will showing :

For the primary interface, wich is ussually eth0, you will see these lines:
# The primary network interface auto eth0 iface eth0 inet dhcp
As you can see, it’s using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you’d customize this to your network.
# The primary network interface auto eth0 iface eth0 inet static address 192.168.1.101 netmask 255.255.255.0 gateway 192.168.1.1 network 192.168.1.0 broadcast 192.168.1.255

And then press CTRL+O (Write Out) to save your changes then press ‘enter’ key.
CTRL+X to Exit.
You need to also remove the dhcp client for this to stick. You might need to remove dhcp-client3 instead.
sudo apt-get remove dhcp-client
Now we’ll just need to restart the networking components:
sudo /etc/init.d/networking restart
Happy to try!

