Skip to Content

How to Install Ubuntu Server 18.04 over a Network

This tutorial will show you how to create a PXE server and use it to install Ubuntu over a network. This is ideal if you want to install Ubuntu on a large number of computers at once.


In this guide, I will show you how to create a PXE server on Ubuntu 18.04 using Dnsmasq. The PXE server will hand out IP addresses using DHCP and will serve the Ubuntu netboot files over TFTP.

We will also configure a client to PXE boot and install Ubuntu over the network using the minimal amount of packages needed to start the system.

After installing Ubuntu on the client machine, any future packages will be downloaded from the internet.


Before we begin, you will need to install Ubuntu Server 18.04configure it with a static IP and install Dnsmasq. You will also need a client machine with PXE boot enabled in the BIOS.

If you don’t have the physical hardware required to perform the steps below, you can use a desktop virtualization program such as VMware Workstation* or VMware Fusion* to follow along.

In this tutorial, I’m using a MacBook Pro with VMware Fusion 11.5* to run two virtual machines, one for the PXE server, and the other as the client, which will have Ubuntu installed over the network.

Let’s begin.

Step 1: Install and Configure Dnsmasq

In this tutorial, I will use the following network settings, but you’ll want to change them to suit your environment:

PXE Server
IP Address:
DHCP Range: to
Domain:     example.lab
hostname:   dnsmasq

Follow the steps in this tutorial. to install Dnsmasq on Ubuntu. Once finished, you should have a dnsmasq.conf file that looks like the following:Advertisements

# Global settings

# Upstream nameservers

# domain name


# DHCP options

Modify the network settings in the file to suit your environment.

Note: Since we are using the DHCP server built-in to Dnsmasq, you may need to disable any other DHCP server you have on your network.

Step 2: Enable TFTP Server and Download Ubuntu Netboot files

Add the following options to the file to enable the TFTP server:


Download and extract the Ubuntu files to the tftp root directory by running the following commands:

cd /tmp
sudo tar -xvzf netboot.tar.gz -C /srv/tftp/
sudo chown -R nobody:nogroup /srv/tftp/

Step 3: Configure the DHCP Server to send the name of the boot image

Add the following option to the dnsmasq.conf file to send the name of the image to boot.


Determine the MAC address of your client machine that you want to install Ubuntu on.

If you’re following along using VMware Fusion, it can be found by clicking Settings, then on the Network Adapter and then Advanced Settings.VMware Fusion Network Settings

Now assuming your MAC address is 00:50:56:39:87:7A and you want to assign an IP address of, add the following to the dnsmasq.conf file:


Save the changes and restart dnsmasq with the following command to apply the changes:

sudo systemctl restart dnsmasq

Step 4: Power on Client and Test

Power on your client machine and it should boot using PXE. The DHCP server will assign it the fixed IP address specified in the previous step and then the client will download the Ubuntu boot image from the TFTP server.

The following screenshots show this in action on a VMware Fusion virtual machine.

Note: After clicking install, the screen will freeze for a minute as the files are transferred.

Now you can walk through the installation of Ubuntu as you would normally.


In this tutorial, we configured Dnsmasq on Ubuntu Server 18.04 to work as a DHCP, PXE and TFTP server. We setup a fixed IP for a client and tested booting the Ubuntu net installer over the network.

Next steps

After installing Ubuntu over the network, future packages will be downloaded from the internet. Depending on how many machines you have on the network, you might want to change it so that all files are downloaded over the local network. Another thing you might want to do, is use a Kickstart file to fully automate the installation.