• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Unite Innovations

  • Professional Services
    • Advanced Multi-functional Security And Utility Appliance
    • Computer Repair
    • Data Recovery And Disposal
    • I.T. Services
    • Identity And Credit Theft Protection And Monitoring
    • Internet Marketing
    • Managed Cloud Based (VOIP) Phone Service
    • Monitoring And Inventory
    • Online Backup And Storage
  • Posts
  • Locations
    • Loxahatchee, FL Location
  • About Us

How To Configure A Static IP Address On Your Ubuntu 18.04 Server

February 14, 2019 By Unite Innovations

To configure a static IP address on your Ubuntu 18.04 server you need to modify a relevant netplan network configuration file within /etc/netplan/ directory.

For example you might find there a default netplan configuration file called 01-netcfg.yaml or 50-cloud-init.yaml with a following content instructing the networkd deamon to configure your network interface via DHCP:

# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: enp0s3: dhcp4: yes

To set your network interface enp0s3 to static IP address 192.168.1.222 with gateway 192.168.1.1 and DNS server as 8.8.8.8 and 8.8.4.4 replace the above configuration with the one below.

WARNING:
You must adhere to a correct code indent for each line of the block. In other words the prefix number of spaces for each line is important. Otherwise you may end up with an error message similar to: Invalid YAML at //etc/netplan/01-netcfg.yaml line 7 column 6: did not find expected key

# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: enp0s3: dhcp4: yes

Once ready apply changes with:

$ sudo netplan apply

In case you run into some issues execute:

$ sudo netplan --debug apply

Filed Under: Tutorials

Primary Sidebar

Dade, Broward, Palm Beach Or Jupiter
(305) 523-9118

Let’s work together

Get in touch with us and send some basic info about your project.

Contact Us

Footer

Social

Follow along on social media.

Unite Innovations FaceBook
Unite Innovations Instagram
Unite Innovations YouTube Channel

Navigation

  • About Us
  • Services
  • Locations
  • Professional Services

Loxahatchee Mailing Address

7040 Seminole Pratt Whitney Rd, # 25-83
Loxahatchee, FL 33470
(305) 523-9118
Mo,Tu,We,Th,Fr 9:00 am – 5:00 pm

Copyright © 2025 · Unite Innovations