A lightweight, customizable, and secure SFTP server built with Docker and OpenSSH.
SimpleSFTP provides an easy way to deploy a secure and flexible SFTP server using Docker. It supports dynamic user creation via environment variables or config files, with options for password authentication, SSH keys, custom UID/GID, and volume mounting.
📦 Docker Hub: daviguides/simple-sftp
- Easy setup with Docker
- User management through environment variables or configuration files
- Support for SSH keys
- Customizable host keys
- Lightweight and efficient
To run a simple SFTP server using Docker:
docker run -p 22:22 -d simplesftp foo:pass:::upload
Define users using the SFTP_USERS
environment variable or in a configuration file. The format is:
user:pass[:e][:uid[:gid[:dir1[,dir2]...]]]
To create a user that can upload files:
docker run -v <host-dir>/upload:/home/foo/upload -p 2222:22 -d simplesftp foo:pass
You can define multiple users in the SFTP_USERS
variable:
docker run -e SFTP_USERS="foo:pass:1001,bar:pass:1002" -p 2222:22 -d simplesftp
To allow login using SSH keys, mount the public key:
docker run -v <host-dir>/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro -p 2222:22 -d simplesftp foo::
To use your own SSH host keys:
docker run -v <host-dir>/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key -p 2222:22 -d simplesftp foo::
Ensure proper permissions on mounted volumes to allow users to write files. Use UID/GID settings as needed.
You can place scripts in /etc/sftp.d/
to customize startup behavior.
SimpleSFTP offers a modernized approach to SFTP server management, focusing on simplicity, flexibility, and performance.
MIT License
This project is a fork based on atmoz/sftp.