Skip to content

garethflowers/docker-ftp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FTP Server

A simple FTP server, using vsftpd.

How to use this image

Start a FTP Server instance

To start a container, with data stored in /data on the host, use the following:

... via docker run

docker run \
	--detach \
	--env FTP_PASS=123 \
	--env FTP_USER=user \
	--env PUBLIC_IP=192.168.0.1 \
	--name my-ftp-server \
	--publish 20-21:20-21/tcp \
	--publish 40000-40009:40000-40009/tcp \
	--volume /data:/home/user \
	garethflowers/ftp-server

... via docker compose

services:
    ftp-server:
        container_name: my-ftp-server
        environment:
            - PUBLIC_IP=192.168.0.1
            - FTP_PASS=123
            - FTP_USER=user
        image: garethflowers/ftp-server
        ports:
            - "20-21:20-21/tcp"
            - "40000-40009:40000-40009/tcp" # For passive mode
        volumes:
            - "/data:/home/user"

Configuration

Ports

Port Required? Description Config
21 Required The default port that FTP listens on. listen_port
20 Required The default port for PORT connections to originate. ftp_data_port
40000
40009
Optional The min and max ports to use for PASV connections to originate. pasv_min_port
pasv_max_port

Environment Variables

Variable Default Value Description
FTP_PASS bar The FTP password
FTP_USER foo The FTP username
UID 1000 User ID for the $FTP_USER user
GID 1000 Group ID for the $FTP_USER user
PUBLIC_IP 0.0.0.0 Public IP address to use for Passive connections.

License