Skip to main content
Version: Stable

How to setup a static ip using Netplan

This tutorials will walk you though the steps required to configure a server static IP address by modifying the Netplan configuration.

1. Edit the configuration

First find the right Netplan configuration filename, and edit the file:

cd /etc/netplan && ls  # find the netplan filename
sudo nano ##-network-manager-all.yaml

If the Netplan configuration is empty, fill in the file with the example below. Otherwise, input the IP address reserved for the server in format, the gateway (the IP address of your router), and your DNS server's address.

version: 2
renderer: networkd
addresses: []
addresses: []

If you don't have your own DNS server you can use the router's address in most cases or a public DNS server like Google or Cloudflare

2. Apply the configuration

After the Netplan file has been saved, apply the changes by running:

sudo netplan apply