Mark Ku's Blog

Background

Our Germany and US sites needed a brand new FTP server. After spending some time researching and trying a few Docker-based FTP solutions, I finally found SFTPGo — an open-source SFTP server with a proper Web UI.

SFTPGo — Official Overview

A fully-featured, highly configurable SFTP server with optional HTTP/S, FTP/S, and WebDAV support. Supported storage backends include: local filesystem, encrypted local filesystem, S3-compatible object storage, Google Cloud Storage, Azure Blob Storage, and other SFTP servers. It ships with both a WebAdmin and a WebClient interface and supports configuration backup through the UI.

SFTPGo official website GitHub

A Quick Overview of Common FTP Protocols

Since we are talking about FTP, here is a brief comparison of the common protocols:

1. SFTP

SFTP (Secure File Transfer Protocol) provides encrypted file transfer over SSH (port 22). It only needs a single port, making firewall configuration much simpler.

2. FTP / FTPS

FTP is the classic file transfer protocol. FTPS is the SSL/TLS-encrypted variant. There are two connection modes:

  • Active mode (PORT): The client opens a random port to receive data, then tells the server that port number via the PORT command (control port 21). The server connects from its port 20 to the client-specified port. This can cause issues when the client's firewall blocks inbound connections from the FTP server.
  • Passive mode (PASV): The client requests a passive connection from the server, which opens a random port and notifies the client. The client then initiates the data connection.

In summary, the key difference is who initiates the data connection and how, which affects firewall requirements. Passive mode is generally better suited to modern network environments, especially when the client is behind a restrictive firewall.

Note: SFTPGo currently only reliably supports SFTP. I tried FTP/S for quite a while and could not get it working. For now, SFTP is the way to go — it only needs a single port.

Prerequisites

  • Install Docker Desktop on the host machine.
  • Set up and configure Cloudflare Tunnel, binding it to the ports required by SFTPGo. (SFTPGo's web UI is exposed through Cloudflare Tunnel so users can upload files via the browser. For SFTP, Cloudflare Tunnel still has some bugs, so I use a direct firewall rule to expose the SFTP port instead.)
image
image

Step 1: Create and Start the FTP Docker Container

docker run -d --name sftpgo --restart always -p 8080:8080 -p 2022:2022 -p 8090:8090 -e TZ=America/Los_Angeles -e SFTPGO_HTTPD__BINDINGS__0__PORT=8080  -e SFTPGO_WEBDAVD__BINDINGS__0__PORT=8090 -v E:\ftp\:/srv/sftpgo drakkan/sftpgo

SFTPGo Default Directories

  • SFTP/FTP/WebDAV default directory: /srv/sftpgo
  • User default directory: /srv/sftpgo/data/{UserName}
  • Host key directory: /var/lib/sftpgo

SFTPGo TCP Ports

  • 2022 — SFTP service
  • 8080 — Web Admin UI
  • 8090 — WebDAV

Step 2: Access the Web Admin UI and Create an Admin Account

http://localhost:8080/web/admin/setup

image
image

Step 3: Log In, Then Navigate to Users > Click "+" to Create an FTP Account

http://localhost:8080/web/admin/login

image
image

Note: The default home directory is /srv/sftpgo/data/{your-username}. If you want all accounts to share the same root — for example /srv/sftpgo/cdn — set that in the Home Dir field.

Step 4: Test the Account via Web Client

http://localhost:8080/web/client/login

Step 5: Test with FileZilla Client

1. Download and install FileZilla Client

2. File > Site Manager > New Site > Set protocol to "SFTP - SSH File Transfer Protocol"

image
image

Step 6: Mount WebDAV as a Network Drive on Windows

1. Configure the registry path with an elevated PowerShell session

// Configure
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WebClient\Parameters" -Name "BasicAuthLevel" -Value 2

// Check BasicAuthLevel
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WebClient\Parameters" -Name "BasicAuthLevel"

// Restart WebClient
net stop webclient
net start webclient

2. Open This PC > click "..." > Add a network location

image
image

3. Enter the WebDAV host address, IP, and credentials

image
image

4. Continue

image
image

5. Done

image
image

Closing Thoughts

The open-source ecosystem keeps producing remarkably capable and easy-to-use tools. For anyone with some technical background, these projects offer enormous flexibility — you can adapt and extend them to fit your exact needs. This post aimed to provide a concise guide to spinning up a Docker-based FTP server with a Web UI using Cloudflare Tunnel and SFTPGo. I hope it helps you get up and running with these powerful open-source tools more easily.

References

Reference

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··602

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··490

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··333

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··264

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··221

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··215

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11