Low Orbit Flux Logo 2 D

Ubuntu Server 20.04 Static IP

We’re going to cover how to set up a static IP address on Ubuntu Server 20.04. Ubuntu has been using the Netplan network management tool by default since Ubuntu 17.10. This has replaced the use of the ifconfig command and the /etc/network/interfaces configuration file.

NOTE - If you are using Ubuntu cloud you might need to disable some extra things.

Depending on whether you are using the server or desktop system there should be a different backend system (renderer) in use by Netplan.

Two supported renderers for Netplan:

Find your interface name. Use any one of the following commands:

ip a
ip link
sudo lshw -class network

My interface looked like this: enp0s3

The Netplan configs can be found here:


There should be at least one file in this directory and that will probably hold your current configuration. The file names can supposedly vary wildly.

I had only this file one file on a freshly installed system, yours might be different:


You could just configure this file directly or you could rename it first. You could also delete it and create a new config instead. The manual recommends using the following name:


I recommend renaming it like this:

mv /etc/netplan/00-installer-config.yaml /etc/netplan/99_config.yaml

It should have DHCP enabled by default and will look something like this:

  version: 2
  renderer: networkd
      dhcp4: true

Under your interface, set dhcp4 to no. Add one or more addresses. Define a gateway. Specify one or more DNS servers. To use Google’s DNS servers you can specify and This is helpful to avoid being blocked by your ISP.

IMPORTANT - Use the correct spacing in the config file.

Here is a working example with my network device:

  version: 2
  renderer: networkd
      dhcp4: no
          addresses: [,]

You can also specify domains to search by default.

          addresses: [,]
          search: [domain1, domain2]

Apply the changes:

sudo netplan apply

Verify that the changes are in place:

ip addr show dev enp0s3

Changing Hostname

If you want to change your hostname just update it in these two files: