How to Install TFTP Server on Ubuntu 20.04 Server

For some old network devices, TFTP Server are really important to backup the device configuration or upgrade the device firmware. Even on many modern devices, TFTP server still supported as configuration backup source and firmware upgrade source. For that reason, it is a good idea to have one TFTP Server.

Install and configure Ubuntu TFTP Server on Ubuntu 20.04 server is very easy, there is no specific requirement needed. As long as your machine have Ubuntu Operating System installed, that's enough to make sure TFTP server will run on it too.

How to Install Ubuntu TFTP Server?

1. Become root
 sudo su
enter your user password then enter
You can also use sudo in every command and just need to enter the user password once, but I prefer become root and do everything after it without sudo command. So, the rest of this tutorial, assuming you are doing the same to become root first.

2. Install tftpd-hpa
 apt install tftpd-hpa -y
How to Install TFTP Server on Ubuntu 20.04 Server
Install Ubuntu TFTP Server
Note: make sure you are connected to the internet. If there is an error, try apt update -y to update your application repository database.

3. Edit tftpd-hpa configuration file
 nano /etc/default/tftpd-hpa
How to Install TFTP Server on Ubuntu 20.04 Server
Edit tftpd-hpa configuration file
You only need to add --create to the TFTP_OPTIONS line to be able to upload to TFTP server. And also take a note for TFTP_USERNAME and TFTP_DIRECTORY

4. Change working directory owner
 chown tftp:tftp /srv/tftp
How to Install TFTP Server on Ubuntu 20.04 Server
After the TFTP server installation, it will create /srv/tftp directory which will be the root directory to store and transfer files to TFTP client.

This directory is belong to root with nogroup, but TFTP server are working under tftp user and have no permission on that directory. You can either change the folder permission with chmod or change the folder owner and group to tftp (See TFTP_USERNAME line from the configuration file).Make sure the folder owner and group has changed by ls -l /srv command.

5. Restart tftpd-hpa service and make sure it is running and active
 systemctl restart tftpd-hpa
 systemctl status tftpd-hpa
How to Install TFTP Server on Ubuntu 20.04 Server
The service must be active and running, systemctl status tftpd-hpa will also shows you the error if something is wrong. Next post, I will post about How to configure tftpd-hpa to change TFTP Server root directory

Related Posts


    Subscribe Our Newsletter