Would you like to learn how to download files from an FTP server using Python? In this tutorial, we are going to show you how to use Python to download files from an FTP server on a computer running Linux.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• Python 3.8.5
• Python 2.7.18

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial Python 3 - Download file from FTP server

List the remote files from the FTP server using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Download a file from the FTP server using Python.

Copy to Clipboard

In our example, we downloaded an application named FIREFOXINSTALLER.

In our example, we saved the download inside the TMP directory.

In our example, we used the binary mode.

Access the directory and verify if the file was downloaded correctly.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Optionally, download a file from the FTP server.

Copy to Clipboard

Congratulations! You are able to download files from the FTP server using Python 3.

Tutorial Python 2 - Download file from FTP server

Download a file from the FTP server using Python 2.

Copy to Clipboard

Congratulations! You are able to download files from the FTP server using Python 2.