|
| 1 | +--- |
| 2 | +type: docs |
| 3 | +linkTitle: SFTPGo |
| 4 | +title: SFTPGo |
| 5 | +description: Deploy SFTPGo on Clever Cloud with Docker to set up a custom SFTP server with user management and Cellar S3 storage backend |
| 6 | +keywords: |
| 7 | +- sftpgo |
| 8 | +- sftp |
| 9 | +- ftp |
| 10 | +- file transfer |
| 11 | +- docker |
| 12 | +- cellar |
| 13 | +- s3 storage |
| 14 | +- file management |
| 15 | +- webdav |
| 16 | +aliases: |
| 17 | +- /sftpgo |
| 18 | +--- |
| 19 | + |
| 20 | +{{< hextra/hero-subtitle >}} |
| 21 | + SFTPGo is a modern, open-source SFTP server with multi-user management, a web interface and S3-compatible storage backends like Cellar. |
| 22 | +{{< /hextra/hero-subtitle >}} |
| 23 | + |
| 24 | +## Overview |
| 25 | + |
| 26 | +Clever Cloud provides built-in SFTP access to [FS Buckets](/doc/addons/fs-buckets/), but if you need advanced user management, fine-grained access control, or want to expose files stored in [Cellar](/doc/addons/cellar/) over SFTP, you can deploy SFTPGo as a Docker application. |
| 27 | + |
| 28 | +> [!WARNING] Only the SFTP protocol works out of the box on Clever Cloud |
| 29 | +> FTP (non-encrypted) requires a dedicated TCP port range. Contact [Clever Cloud support](https://console.clever-cloud.com/ticket/center) to enable it. |
| 30 | +
|
| 31 | +## Requirements |
| 32 | + |
| 33 | +You need [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and a [Clever Cloud account](https://console.clever-cloud.com). |
| 34 | + |
| 35 | +## Create and configure resources on Clever Cloud |
| 36 | + |
| 37 | +1. Create a **Docker** application (XS size or above) from the [Console](https://console.clever-cloud.com) |
| 38 | +2. Create a **PostgreSQL** add-on (version 15, XXS Small Space) and link it to your application |
| 39 | +3. Create a **Cellar** add-on for S3-compatible object storage and link it to your application |
| 40 | +4. Enable **TCP redirection** on your Docker application from the Console |
| 41 | + |
| 42 | +## Prepare the project |
| 43 | + |
| 44 | +Initialize a Git repository with a minimal **Dockerfile**: |
| 45 | + |
| 46 | +```bash |
| 47 | +mkdir my-sftpgo && cd my-sftpgo |
| 48 | +git init |
| 49 | +``` |
| 50 | + |
| 51 | +Create a **Dockerfile** at the root of the project |
| 52 | + |
| 53 | +```bash |
| 54 | +FROM drakkan/sftpgo:latest |
| 55 | +``` |
| 56 | + |
| 57 | +## Set environment variables |
| 58 | + |
| 59 | +Add the following environment variables to your Docker application in the console. Replace placeholder values with the credentials provided by Clever Cloud for your PostgreSQL add-on: |
| 60 | + |
| 61 | +```bash |
| 62 | +CC_DOCKER_EXPOSED_TCP_PORT="2022" |
| 63 | +SFTPGO_DATA_PROVIDER__DRIVER="postgresql" |
| 64 | +SFTPGO_DATA_PROVIDER__HOST="<pg_host>" |
| 65 | +SFTPGO_DATA_PROVIDER__NAME="<pg_dbname>" |
| 66 | +SFTPGO_DATA_PROVIDER__PASSWORD="<pg_password>" |
| 67 | +SFTPGO_DATA_PROVIDER__PORT="<pg_port>" |
| 68 | +SFTPGO_DATA_PROVIDER__USERNAME="<pg_user>" |
| 69 | +``` |
| 70 | + |
| 71 | +## Deploy |
| 72 | + |
| 73 | +First, commit and push your code: |
| 74 | + |
| 75 | +```bash |
| 76 | +git add . |
| 77 | +git commit -m "Deploy SFTPGo" |
| 78 | +clever link <your-app-id> |
| 79 | +clever deploy |
| 80 | +``` |
| 81 | + |
| 82 | +Or using a Git remote: |
| 83 | + |
| 84 | +```bash |
| 85 | +git remote add clever <your-clever-git-url> |
| 86 | +git push clever master |
| 87 | + |
| 88 | +``` |
| 89 | + |
| 90 | +## Initialize SFTPGo |
| 91 | + |
| 92 | +1. Open your application URL in a browser |
| 93 | +2. Follow the setup wizard to create an **admin account** |
| 94 | + |
| 95 | +## Connect Cellar as a storage backend |
| 96 | + |
| 97 | +In the SFTPGo web admin interface, create a new user with an **S3-compatible** filesystem: |
| 98 | + |
| 99 | +| Setting | Value | |
| 100 | +|---------|-------| |
| 101 | +| Bucket | Your Cellar bucket name | |
| 102 | +| Region | FR | |
| 103 | +| Access Key | Your Cellar Key ID | |
| 104 | +| Access Secret | Your Cellar Key Secret | |
| 105 | +| Endpoint | https://cellar-c2.services.clever-cloud.com | |
| 106 | + |
| 107 | + |
| 108 | +## Connect with an SFTP client |
| 109 | + |
| 110 | +Use any SFTP client (such as FileZilla, Cyberduck, or the sftp CLI) with: |
| 111 | + |
| 112 | +- Host: shown in the TCP redirection tab of your application in the console |
| 113 | +- Port: shown in the TCP redirection tab |
| 114 | +- Username & Password: your SFTPGo admin credentials |
| 115 | + |
| 116 | +## 🎓 Learn more |
| 117 | + |
| 118 | +{{< cards >}} |
| 119 | + {{< card link="/developers/doc/applications/docker" title="Deploy a Docker application" subtitle="How to configure your Docker app" icon="docker" >}} |
| 120 | + {{< card link="/developers/doc/addons/cellar" title="Cellar Object Storage" subtitle="S3-compatible storage on Clever Cloud" icon="database" >}} |
| 121 | + {{< card link="/developers/doc/addons/fs-bucket" title="FS Buckets" subtitle="Built-in persistent file storage with SFTP access" icon="database" >}} |
| 122 | + {{< card link="https://docs.sftpgo.com/" title="SFTPGo Documentation" subtitle="Official SFTPGo documentation" icon="book-open" >}} |
| 123 | +{{< /cards >}} |
0 commit comments