You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Carlos Mogas da Silva 64d97a2e21 Missing \n 1 year ago
.drone.yml Update more documentation and repush to Docker Hub 1 year ago
Dockerfile Force ownership of /home/data 1 year ago Missing \n 1 year ago
docker-compose.yml Update more documentation and repush to Docker Hub 1 year ago Some more fixups for the previous commit 1 year ago

SFTP server

Restricted SSH server which allows SFTP access only. This image is meant to provide an ability to update content in data containers. You would normally make a constellation of your service, a data container, and the sftp-server container.

The sftp-server container is configured at runtime with environment variables to match the configuration of the main service. The environment variables are:

Environment Variables:

  • AUTHORIZED_KEYS - contains the public SSH keys for the users who will be allowed to upload.
  • USERID - The numeric id of the data account. Defaults to 33.
  • GROUPID - The numeric id of the data group. Defaults to 33.


  • /home/data - Directory where all your data is
  • /etc/ssh/host_keys - Generated HostKeys go here. Mount a volume here so they don't get regenerated all the time the container boots.


It is easiest if you use docker-compose. Then you can specify the authorized SSH keys in a block declaration:

docker-compose.yml file:

  image: r3pek/sftp-server
  - <PORT>:22
      ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA4FhFro3H....vg0hrC3s0= My First CERT
      ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAteQ38qb7....uC839w== Second authorized key 
    USERID: 500
    GROUPID: 500
  - <DATADIR>:/home/data

  image: httpd
  - 80:80
  - htdocs

  image: tianon/true
  - <DATADIR>:/usr/local/apache2/htdocs

When started you can upload data into the container as the data user:

sftp -P <PORT> data@<DOCKER-HOST>

Original code and idea is from

Forked from