{"id":21905103,"url":"https://github.com/emberstack/docker-sftp","last_synced_at":"2025-04-07T13:08:49.066Z","repository":{"id":36054135,"uuid":"219346647","full_name":"emberstack/docker-sftp","owner":"emberstack","description":"SFTP Server for Docker","archived":false,"fork":false,"pushed_at":"2024-07-06T14:25:48.000Z","size":140,"stargazers_count":197,"open_issues_count":28,"forks_count":51,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-31T11:06:19.781Z","etag":null,"topics":["docker","docker-cli","docker-compose","helm","kubernetes","openssh","openssh-server","secure","sftp"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emberstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-03T18:30:55.000Z","updated_at":"2025-03-13T14:28:43.000Z","dependencies_parsed_at":"2023-01-16T12:28:36.910Z","dependency_job_id":"61a47ee4-6ae6-4d21-9f1a-fc8de982c86a","html_url":"https://github.com/emberstack/docker-sftp","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberstack%2Fdocker-sftp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberstack%2Fdocker-sftp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberstack%2Fdocker-sftp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberstack%2Fdocker-sftp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emberstack","download_url":"https://codeload.github.com/emberstack/docker-sftp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-cli","docker-compose","helm","kubernetes","openssh","openssh-server","secure","sftp"],"created_at":"2024-11-28T16:29:23.662Z","updated_at":"2025-04-07T13:08:48.998Z","avatar_url":"https://github.com/emberstack.png","language":"C#","readme":"# SFTP ([SSH File Transfer Protocol](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol)) server using [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH)\nThis project provides a Docker image for hosting a SFTP server. Included are `Docker` (`docker-cli` and `docker-compose`) and `Kubernetes` (`kubectl` and `helm`) deployment scripts\n\n[![Pipeline](https://github.com/emberstack/docker-sftp/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/emberstack/docker-sftp/actions/workflows/pipeline.yaml)\n[![Release](https://img.shields.io/github/release/emberstack/docker-sftp.svg?style=flat-square)](https://github.com/emberstack/docker-sftp/releases/latest)\n[![Docker Image](https://img.shields.io/docker/image-size/emberstack/sftp?style=flat-square)](https://hub.docker.com/r/emberstack/sftp)\n[![Docker Pulls](https://img.shields.io/docker/pulls/emberstack/sftp?style=flat-square)](https://hub.docker.com/r/emberstack/sftp)\n[![license](https://img.shields.io/github/license/emberstack/docker-sftp.svg?style=flat-square)](LICENSE)\n\n\u003e Supports architectures: `amd64`, `arm` and `arm64`\n\n### Support\nIf you need help or found a bug, please feel free to open an issue on the [emberstack/docker-sftp](https://github.com/emberstack/docker-sftp) GitHub project.  \n\n## Usage\n\nThe SFTP server can be easily deployed to any platform that can host containers based on Docker.\nBelow are deployment methods for:\n- Docker CLI\n- Docker-Compose\n- Kubernetes using Helm (recommended for Kubernetes)\n\nProcess:\n1) Create server configuration\n2) Mount volumes as needed\n3) Set host file for consistent server fingerprint\n\n### Configuration\n\nThe SFTP server uses a `json` based configuration file for default server options and to define users. This file has to be mounted on `/app/config/sftp.json` inside the container.\nEnvironment variable based configuration is not supported (see the `Advanced Configuration` section below for the reasons).\n\nBelow is the simplest configuration file for the SFTP server:\n\n```json\n{\n    \"Global\": {\n        \"Chroot\": {\n            \"Directory\": \"%h\",\n            \"StartPath\": \"sftp\"\n        },\n        \"Directories\": [\"sftp\"]\n    },\n    \"Users\": [\n        {\n            \"Username\": \"demo\",\n            \"Password\": \"demo\"\n        }\n    ]\n}\n```\nThis configuration creates a user `demo` with the password `demo`. \nA directory \"sftp\" is created for each user in the own home and is accessible for read/write. \nThe user is `chrooted` to the `/home/demo` directory. Upon connect, the start directory is `sftp`.\n\nYou can add additional users, default directories or customize start directories per user. You can also define the `UID` and `GID` for each user. See the `Advanced Configuration` section below for all configuration options.\n\n\n### Deployment using Docker CLI\n\n\u003e Simple Docker CLI run\n\n```shellsession\n$ docker run -p 22:22 -d emberstack/sftp --name sftp\n```\nThis will start a SFTP in the container `sftp` with the default configuration. You can connect to it and login with the `user: demo` and `password: demo`.\n\n\u003e Provide your configuration\n\n```shellsession\n$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro\n```\nThis will override the default (`/app/config/sftp.json`) configuration with the one from the host `/host/sftp.json`.\n\n\u003e Mount a directory from the host for the user 'demo'\n\n```shellsession\n$ docker run -p 22:22 -d emberstack/sftp --name sftp -v /host/sftp.json:/app/config/sftp.json:ro -v /host/demo:/home/demo/sftp\n```\nThis will mount the `demo` directory from the host on the `sftp` directory for the \"demo\" user.\n\n\n### Deployment using Docker Compose\n\n\u003e Simple docker-compose configuration\n\nCreate a docker-compose configuration file:\n```yaml\nversion: '3'\nservices:\n  sftp:\n    image: \"emberstack/sftp\"\n    ports:\n      - \"22:22\"\n    volumes:\n      - ../config-samples/sample.sftp.json:/app/config/sftp.json:ro\n```\nAnd run it using docker-compose\n```shellsession\n$ docker-compose -p sftp -f docker-compose.yaml up -d\n```\n\nThe above configuration is available in the `deploy\\docker-compose` folder in this repository. You can use it to start customizing the deployment for your environment.\n\n\n\n### Deployment to Kubernetes using Helm\n\nUse Helm to install the latest released chart:\n```shellsession\n$ helm repo add emberstack https://emberstack.github.io/helm-charts\n$ helm repo update\n$ helm upgrade --install sftp emberstack/sftp\n```\n\nYou can customize the values of the helm deployment by using the following Values:\n\n| Parameter                                                   | Description                                                                      | Default                                                 |\n| ------------------------------------                        | -------------------------------------------------------------------------------- | ------------------------------------------------------- |\n| `nameOverride`                                              | Overrides release name                                                           | `\"\"`                                                    |\n| `fullnameOverride`                                          | Overrides release fullname                                                       | `\"\"`                                                    |\n| `image.repository`                                          | Container image repository                                                       | `emberstack/sftp`                                       |\n| `image.tag`                                                 | Container image tag                                                              | `latest`                                                |\n| `image.pullPolicy`                                          | Container image pull policy                                                      | `Always` if `image.tag` is `latest`, else `IfNotPresent`|\n| `storage.volumes`                                           | Defines additional volumes for the pod                                           | `{}`                                                    |\n| `storage.volumeMounts`                                      | Defines additional volumes mounts for the sftp container                         | `{}`                                                    |\n| `configuration`                                             | Allows the in-line override of the configuration values                          | `null`                                                  |\n| `configuration.Global.Chroot.Directory`                     | Global chroot directory for the `sftp` user group. Can be overriden per-user     | `\"%h\"`                                                  |\n| `configuration.Global.Chroot.StartPath`                     | Start path for the `sftp` user group. Can be overriden per-user                  | `\"sftp\"`                                                |\n| `configuration.Global.Directories`                          | Directories that get created for all `sftp` users. Can be appended per user      | `[\"sftp\"]`                                              |\n| `configuration.Global.HostKeys.Ed25519`                     | Set the server's ED25519 private key                                             | `\"\"`                                                    |\n| `configuration.Global.HostKeys.Rsa`                         | Set the server's RSA private key                                                 | `\"\"`                                                    |\n| `configuration.Users`                                       | Array of users and their properties                                              | Contains `demo` user by default                         |\n| `configuration.Users[].Username`                            | Set the user's username                                                          | N/A                                                     |\n| `configuration.Users[].Password`                            | Set the user's password. If empty or `null`, password authentication is disabled | N/A                                                     |\n| `configuration.Users[].PasswordIsEncrypted`                 | `true` or `false`. Indicates if the password value is already encrypted          | `false`                                                 |\n| `configuration.Users[].AllowedHosts`                        | Set the user's allowed hosts. If empty, any host is allowed                      | `[]`                                                    |\n| `configuration.Users[].PublicKeys`                          | Set the user's public keys                                                       | `[]`                                                    |\n| `configuration.Users[].UID`                                 | Sets the user's UID.                                                             | `null`                                                  |\n| `configuration.Users[].GID`                                 | Sets the user's GID. A group is created for this value and the user is included  | `null`                                                  |\n| `configuration.Users[].Chroot`                              | If set, will override global `Chroot` settings for this user.                    | `null`                                                  |\n| `configuration.Users[].Directories`                         | Array of additional directories created for this user                            | `null`                                                  |\n| `initContainers`                                            | Additional initContainers for the pod                                            | `{}`                                                    |\n| `resources`                                                 | Resource limits                                                                  | `{}`                                                    |\n| `nodeSelector`                                              | Node labels for pod assignment                                                   | `{}`                                                    |\n| `tolerations`                                               | Toleration labels for pod assignment                                             | `[]`                                                    |\n| `affinity`                                                  | Node affinity for pod assignment                                                 | `{}`                                                    |\n\n\u003e Find us on [Helm Hub](https://hub.helm.sh/charts/emberstack)\n\n\n## Advanced Configuration\n\nTODO: This section is under development due to the number of configuration options being added. Please open an issue on the [emberstack/docker-sftp](https://github.com/emberstack/docker-sftp) project if you need help.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femberstack%2Fdocker-sftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femberstack%2Fdocker-sftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femberstack%2Fdocker-sftp/lists"}