{"id":20856690,"url":"https://github.com/tshenolo/docker-sftp-server-with-sshkey","last_synced_at":"2025-04-16T01:09:26.934Z","repository":{"id":231645515,"uuid":"773175103","full_name":"tshenolo/docker-sftp-server-with-sshkey","owner":"tshenolo","description":"Docker SFTP Server","archived":false,"fork":false,"pushed_at":"2024-08-14T21:08:04.000Z","size":29,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T01:09:21.618Z","etag":null,"topics":["docker","sftp","sftp-server","ubuntu"],"latest_commit_sha":null,"homepage":"https://medium.com/p/ce9bddb77f39","language":"Dockerfile","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/tshenolo.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":"2024-03-16T23:54:31.000Z","updated_at":"2024-11-26T21:18:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d65dfde-15b2-46f9-9831-1a85970ddf4f","html_url":"https://github.com/tshenolo/docker-sftp-server-with-sshkey","commit_stats":null,"previous_names":["tshenolo/docker-sftp-server-with-sshkey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshenolo%2Fdocker-sftp-server-with-sshkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshenolo%2Fdocker-sftp-server-with-sshkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshenolo%2Fdocker-sftp-server-with-sshkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tshenolo%2Fdocker-sftp-server-with-sshkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tshenolo","download_url":"https://codeload.github.com/tshenolo/docker-sftp-server-with-sshkey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249178212,"owners_count":21225349,"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","sftp","sftp-server","ubuntu"],"created_at":"2024-11-18T04:33:38.894Z","updated_at":"2025-04-16T01:09:26.916Z","avatar_url":"https://github.com/tshenolo.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker SFTP Server with SSH Key\n\n![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge\u0026logo=ubuntu\u0026logoColor=white)\n![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n\n\nThis repository contains the necessary files to deploy a secure SFTP server using Docker. The setup includes volume mounting for persistent storage, key-based authentication for enhanced security, and customizable SSH configurations.\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Quick Start](#quick-start)\n\t- [SSH Key Configuration](#ssh-key-configuration)  \n\t- [Clone this repository](#clone-this-repository) \n\t- [Build the Docker image](#build-the-docker-image) \n\t- [Run the Docker container](#run-the-dockrer-container)\n  - [Connecting to the SFTP Server](#connecting-to-the-sftp-server)   \n- [Conclusion](#conclusion) \n- [License](#license)\n\n## 🎬 Video demonstration\n[![Watch on Youtube](https://img.youtube.com/vi/YWaSJ3fiQhE/0.jpg)](https://www.youtube.com/watch?v=YWaSJ3fiQhE)\n\n## Prerequisites\n- Docker installed on your machine.\n- Basic understanding of Docker and SFTP.\n- Git is also required to clone the repository.\n- Basic knowledge of command-line operations.\n\n## Quick Start\n### SSH Key Configuration  \nGenerate SSH Key: If you do not already have an SSH key pair, you can generate one using the following command:\n```bash\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\" -f $HOME/.ssh/docker_rsa\n```\n\nEnsure your private key (~/.ssh/docker_rsa) is kept secure with the appropriate permissions:\n```bash\nchmod 600 ~/.ssh/docker_rsa\n```\n\nLoad your SSH key into the SSH agent by running:\n```bash\nssh-add ~/.ssh/docker_rsa\n```\n\n### Clone this repository:\n```bash\ngit clone https://github.com/tshenolo/docker-sftp-server-with-sshkey.git\n```\n\nChange your current working directory to the newly cloned repository:\n```bash\ncd docker-sftp-server-with-sshkey\n```\n\nTo ensure SSH key-based authentication for your SFTP server, place your SSH public key into the working directory:\n```bash\ncp $HOME/.ssh/docker_rsa.pub .\n```\n\n\n### Build the Docker image:\n```bash\ndocker build -t my-sftp-server .\n```\n\n### Run the Docker container:  \nTo run your SFTP server container without data persistence, you might use a command like this:\n```bash\ndocker run -d --name my_sftp_container -p 2222:22 my-sftp-server\n```\n\nTo ensure that uploaded files are not lost when the container stops or is removed, you should persist data by mapping a directory from your host machine to a directory inside the container\n```bash\ndocker run -d -v /local/sftp/upload:/home/sftpuser/sftp/upload --name my_sftp_container -p 2222:22 my-sftp-server\n```\n\n### Connecting to the SFTP Server\nConnect to your SFTP server using:\n```bash\nsftp -oPort=2222 sftpuser@localhost\n```\n\n## Conclusion\nThis project simplifies the deployment of a secure SFTP server using Docker. By leveraging Docker's capabilities, you can ensure data persistence, enhance security, and customize configurations to suit your needs.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Thank you for the Support\n- ⭐ Give this repo a ⭐ star ⭐ at the top of the page\n- 🐦 Follow me on [X](https://twitter.com/tshenolo)\n- 📺 Subscribe to my [Youtube channel](https://www.youtube.com/@tshenolo?sub_confirmation=1)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftshenolo%2Fdocker-sftp-server-with-sshkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftshenolo%2Fdocker-sftp-server-with-sshkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftshenolo%2Fdocker-sftp-server-with-sshkey/lists"}