Sign inSign up

haravich/custom-ftp-server

By haravich

•Updated 5 days ago

The FTP server supports the following modes * FTP * FTPS * FTPS Implicit * FTPS TLS

Image
0

10K+

haravich/custom-ftp-server repository overview

⁠FTP Server in Docker based on Alpine Linux

custom-ftp-server build Docker pulls

This repository contains a Docker configuration to set up an FTP server using the Alpine Linux base image. The FTP server supports the following modes

  • FTP (Port 21)
  • FTPS (Port 21) AKA Explicit
  • FTPS Implicit (Port 990)
  • FTPS TLS (Port 21) AKA Explicit with strong cipher

⁠Prerequisites

Before you begin, ensure you have the following installed:

⁠Getting Started

  1. Clone the Repository:

    Clone this repository to your local machine:

    git clone https://github.com/haravich/custom-ftp-server.git
    cd custom-ftp-server
    
  2. Customize Configuration:

    Configure FTP Server:

    • Modify the vsftpd-<FTP_MODE>.conf file to customize the FTP server configuration. You can adjust settings such as user accounts, directory permissions, passive ports range, and security options.

    Default:

    • By default the vsftpd.conf is enabled with required configuration for specific modes.
  3. Generate SSL Certificate:

    Generate an SSL certificate and private key for FTPS if you plan to use secure connections. We do apply a default certficate is the environment variable SSL_SUBJECT not provided.

    SSL_SUBJECT="/C=IN/O=haravich/CN=freeops.dev"
    
  4. Build and Run:

    Build the Docker image and run the container:

    docker build -t custom-ftp-server .
    docker run -d -p 2222:22 -p 20-22:20-22 -p 21100-21110:21100-21110 -p 990:990 haravich/custom-ftp-server
    
    (or)
    
    docker run -d -p 2222:22 -e FTP_MODE=ftps -e -p 20-22:20-22 -p 21100-21110:21100-21110 -p 990:990 haravich/custom-ftp-server
    
    
    (or)
    
    docker run -d -p 2222:22 -e FTP_MODE=ftps -e SSL_SUBJECT="/C=IN/O=haravich/CN=freeops.dev" -p 20-22:20-22 -p 21100-21110:21100-21110 -p 990:990 haravich/custom-ftp-server
    
    ⁠Environment Variables
    VariableDefault ValueAvailable Options
    FTP_USERftpuser(string) name
    FTP_PASSWORDadmin(string) password
    PASV_ENABLEYES(bool) YES/NO
    PASV_ADDRESS-(Valid IP Address) x.x.x.x
    PASV_ADDRESS_INTERFACEeth0(Vlaid ETH interface) xth1
    PASV_ADDR_RESOLVEYES(bool) YES/NO
    PASV_MIN_PORT21100(Port) Any valid port
    PASV_MAX_PORT21110(Port) Any valid port
    FTP_MODEftp(string) ftp/ftps/ftps_implicit/ftps_tls
    LOG_STDOUTYES(bool) YES/NO
    SSL_SUBJECT-(string) /C=IN/O=haravich/CN=freeops.dev

⁠Access FTP Server:

Connect to the FTP server using an FTP client. Use the ftpuser username and the password. For secure FTPS connections, connect to port 21 and choose "FTP with TLS/SSL" or "FTPES" as the protocol.

ftp -p 22 <ftp_user>@localhost

Replace <ftp_user> with appropriate values.

⁠Customization

  • Adjust the FTP server settings in the vsftpd file.
  • Customize the run-vsftpd.sh script to modify for further configs.

⁠License

This project is licensed under the MIT License⁠. See the LICENSE.md⁠ file for details.

Copy and paste this Markdown content into a file named README.md in the root of your repository. Feel free to adjust the formatting and content as needed for your project.

⁠Credits

⁠lhauspie/docker-vsftpd-alpine

The core config files is created and maintained by Logan HAUSPIE⁠. The source code can be found in Github⁠.

The original LICENSE can be found in lhauspie/docker-vsftpd-alpine⁠

Tag summary

Content type

Image

Digest

sha256:89b4a0943…

Size

7.5 MB

Last updated

5 days ago

docker pull haravich/custom-ftp-server