Setting Up Your Own FTP Server with Web GUI Using Docker

Do you need a fast and efficient way to run your own FTP server with a user-friendly web GUI? Look no further! In this post, we'll guide you through the process using the Docker image darkkan/sftpgo.

Step 1: Pull the Docker Image

Start by pulling the Docker image with the following command:

docker pull drakkan/sftpgo:latest

Step 2: Run the Container

Now, run the container with the necessary ports and configurations. Choose one of the following options based on your preferences:

Option 1: Separate Ports for FTP and Web GUI

docker run --name ftp-server \
  -p 80:8080 \
  -p 22:2022 \
  -p 21:2121 \
  -p 50000-50100:50000-50100 \
  --mount type=bind,source=/opt/ftp/data,target=/srv/sftpgo \
  --mount type=bind,source=/opt/ftp/home,target=/var/lib/sftpgo \
  -e SFTPGO_FTPD__BINDINGS__0__PORT=2121 \
  -e SFTPGO_FTPD__BINDINGS__0__FORCE_PASSIVE_IP=<your external IP> \
  -d drakkan/sftpgo:latest

Option 2: Shared Ports for FTP and Web GUI

docker run --name ftp-server \
  -p 8080:8080 \
  -p 2022:2022 \
  -p 2121:2121 \
  -p 50000-50100:50000-50100 \
  --mount type=bind,source=/opt/ftp/data,target=/srv/sftpgo \
  --mount type=bind,source=/opt/ftp/home,target=/var/lib/sftpgo \
  -e SFTPGO_FTPD__BINDINGS__0__PORT=2121 \
  -e SFTPGO_FTPD__BINDINGS__0__FORCE_PASSIVE_IP=<your external IP> \
  -d drakkan/sftpgo:latest

Step 3: Access Your Server

Your FTP/SFTP server with a web GUI is now up and running! If you chose Option 1, use ports 80, 2022, and 2121 for web GUI, SFTP, and FTP connections respectively. For Option 2, use port 8080 for web GUI and ports 2022 and 2121 for SFTP and FTP connections.

Feel free to customize the mount points (data and home directories) based on your preferred host filesystem locations.

Now you have a powerful and easily manageable FTP server at your fingertips. Happy file sharing!

Subscribe to The Code Sandwiches

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe