Today we will conduct deployment tests of FTP servers on Sanfeng Cloud’s free server. The free cloud server provided by Sanfeng Cloud is really a good free server, configured as a 1-core CPU, 1G memory, 10G hard disk and 5M bandwidth, perfectly meeting our needs. No need to worry about insufficient resources and easily meet the challenges of small projects. Next, let's start this technical journey!
Introduction to Docker and FTP Software
Docker is an open source platform for automating the deployment, scaling, and management of applications. It uses container technology to allow developers to package applications and their dependencies into a lightweight container, ensuring consistent operation in different environments. For FTP servers, we usually usevsftpd(Very Secure FTP Daemon), it is a secure and efficient FTP server, widely used in Linux systems, with good performance and security.
Deployment steps
Here are the detailed steps on how to deploy an FTP server via Docker on Ubuntu. Make sure you have Docker installed.
Update the system package:
sudo apt update && sudo apt upgrade -y
Install Docker(If not installed):
sudo apt install -y
Start and set up Docker service:
sudo systemctl start dockersudo systemctl enable docker
Pull vsftpd Docker image:
sudo docker pull fauria/vsftpd
Create an FTP data directory:
sudo mkdir -p /srv/ftp
Run the vsftpd container:
sudo docker run -d \ --name ftp-server \ -p 21:21 \ -v /srv/ftp:/home/vsftpd \ -e FTP_USER=user \ -e FTP_PASS=pass \ -e PASV_ADDRESS=Your serverIP \ -e PASV_MIN_PORT=21100 \ -e PASV_MAX_PORT=21110 \ fauria/vsftpd
Parameter explanation:
-
-d
: Run containers in the background. -
--name ftp-server
: Container name. -
-p 21:21
: Map port 21 of the host to port 21 of the container. -
-v /srv/ftp:/home/vsftpd
: Mount the host directory into the container. -
-e FTP_USER=user
: Set the FTP username. -
-e FTP_PASS=pass
: Set the FTP password. -
-e PASV_ADDRESS=Your server IP
: Set the IP address in passive mode. -
-e PASV_MIN_PORT=21100
: Set the minimum port for passive mode. -
-e PASV_MAX_PORT=21110
: Set the maximum port in passive mode.
Verify that the FTP server is running:
Connect to using the FTP clientftp://your server IP
, use the username and password you just set to log in.
Through the above steps, you can successfully deploy an FTP server on Ubuntu! With the convenience of Docker, we can easily manage and expand services and transfer data anytime, anywhere. I hope you can enjoy this technical journey on Sanfeng Cloud’s free cloud server!
This is the end of this article about using Docker to deploy FTP servers on Ubuntu. For more related content on Docker Ubuntu, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!