FTP is the File Transfer Protocol, a longtime method of transferring files across the internet with directory management.
However, it can be a bit difficult to set up, and read-only access is strongly recommended.
An easier, safer, more accessible alternative would be WebDAV, which uses HTTP servers, has significant performance improvements over FTP..
Note: Make sure your FTP server is read-only. It is not recommended to use FTP to write files (use SFTP instead).
You have the option of either making the FTP anonymous (anybody in the world can download), or login required (using a special FTP user with a password).
Streaming Video from FTP Server
First, open the FTP server in a browser using
ftp:// . Next, copy the URL of the video to play. Finally, follow these instructions to stream them in your favorite media player.
- VLC or Media Player Classic
- First, open the FTP server in a browser. You can do this using
- Next, copy the URL of the video to play.
- Finally, click Open Network Stream (or Open File?), and paste the video URL.
- Android + MX Player
Anonymous FTP Server
In an Anonymous FTP Server, anyone in the world can access and download from the FTP server (but cannot upload).
Create FTP User
Alternatively, if you don't want public access, you can create a read-only FTP account (with no SSH privileges). Create such a user with this command:
sudo useradd -m -G ftp -s /sbin/nologin -d /home/ftpuser ftpuser
VSFTP's most famous security feature is the user chroot, which ensures that FTP users can only access their own home directory. This is absolutely critical if your server is exposed to the outside internet, functioning as a second line of defense in case your user password is compromised.
Add these lines to the end of
Dynamic DNS Address
If you are using a Dynamic DNS address instead of an IP, make sure to specify it in
# Dynamic DNS Address pasv_addr_resolve=YES pasv_address=yourserver.com
Enable FTP Passive Mode
FTP Passive Mode uses multiple ports (for various reasons) instead of just TCP Port 21, and it is strongly recommended to enable it.
However, you will need to port forward a large port range to make this possible.
/etc/vsftpd.conf, and add these settings to set a specific port range for FTP Passive Mode.
port_enable=YES pasv_min_port=65400 pasv_max_port=65534
Next, if you are using a router (if it can transmit WiFi, it is a router), make sure to port forward TCP Port 21 and the port range selected (in this case, TCP
65400-65534). After you restart VSFTP, FTP Passive Mode will work.