Adds an SFTP adapter for the Payload cloud-storage plugin, built on ssh2-sftp-client. Uploads are sent to a remote server over SSH and placed in a subfolder named after the collection slug. It is configured per collection with connection options, a destination root path and a public endpoint.
SFTP adapter for Payload CMS's plugin-cloud-storage plugin
Installation
npm i payloadcms-sftp-storage2
Stars
0
Forks
0
Open Issues
2 years ago
Last Updated
11
Weekly Downloads
v1.0.1
npm Version
6.6 KB
Unpacked Size
3
Dependencies
20 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 2 |
| Dec 4, 2026 | 2 |
| Dec 3, 2026 | 2 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 2 |
| Nov 30, 2026 | 2 |
| Nov 29, 2026 | 2 |
| Nov 28, 2026 | 2 |
| Nov 27, 2026 | 2 |
| Nov 26, 2026 | 2 |
| Nov 25, 2026 | 2 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 2 |
| Nov 21, 2026 | 2 |
| Nov 20, 2026 | 2 |
| Nov 19, 2026 | 2 |
| Nov 18, 2026 | 2 |
| Nov 17, 2026 | 2 |
| Nov 16, 2026 | 2 |
| Nov 15, 2026 | 2 |
| Nov 14, 2026 | 2 |
| Nov 13, 2026 | 2 |
| Nov 12, 2026 | 2 |
| Nov 11, 2026 | 2 |
| Nov 10, 2026 | 2 |
| Nov 9, 2026 | 2 |
| Nov 8, 2026 | 2 |
| Nov 7, 2026 | 2 |
| Nov 6, 2026 | 2 |
| Nov 5, 2026 | 2 |
| Nov 4, 2026 | 2 |
| Nov 3, 2026 | 2 |
| Nov 2, 2026 | 2 |
| Nov 1, 2026 | 2 |
| Oct 31, 2026 | 2 |
| Oct 30, 2026 | 2 |
| Oct 29, 2026 | 2 |
| Oct 28, 2026 | 2 |
| Oct 27, 2026 | 2 |
| Oct 26, 2026 | 2 |
| Oct 25, 2026 | 2 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 2 |
| Oct 13, 2026 | 2 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 2 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 2 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 2 |
| Oct 3, 2026 | 2 |
| Oct 2, 2026 | 2 |
| Oct 1, 2026 | 2 |
| Sep 30, 2026 | 2 |
| Sep 29, 2026 | 2 |
| Sep 28, 2026 | 2 |
| Sep 27, 2026 | 2 |
| Sep 26, 2026 | 2 |
| Sep 25, 2026 | 2 |
| Sep 24, 2026 | 2 |
| Sep 23, 2026 | 2 |
| Sep 22, 2026 | 2 |
| Sep 21, 2026 | 2 |
| Sep 20, 2026 | 2 |
| Sep 19, 2026 | 2 |
| Sep 18, 2026 | 2 |
| Sep 17, 2026 | 2 |
| Sep 16, 2026 | 2 |
| Sep 15, 2026 | 2 |
| Sep 14, 2026 | 2 |
| Sep 13, 2026 | 2 |
| Sep 12, 2026 | 2 |
| Sep 11, 2026 | 2 |
| Sep 10, 2026 | 2 |
| Sep 9, 2026 | 2 |
| Sep 8, 2026 | 2 |
| Sep 7, 2026 | 2 |
| Sep 6, 2026 | 2 |
11+2 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 11 |
| Dec 4, 2026 | 7 |
| Dec 3, 2026 | 9 |
| Dec 2, 2026 | 10 |
| Dec 1, 2026 | 11 |
| Nov 30, 2026 | 11 |
| Nov 29, 2026 | 12 |
| Nov 28, 2026 | 12 |
| Nov 27, 2026 | 18 |
| Nov 26, 2026 | 20 |
| Nov 25, 2026 | 22 |
| Nov 24, 2026 | 20 |
| Nov 23, 2026 | 20 |
| Nov 22, 2026 | 51 |
| Nov 21, 2026 | 62 |
| Nov 20, 2026 | 60 |
| Nov 19, 2026 | 61 |
| Nov 18, 2026 | 63 |
| Nov 17, 2026 | 64 |
| Nov 16, 2026 | 64 |
| Nov 15, 2026 | 89 |
| Nov 14, 2026 | 90 |
| Nov 13, 2026 | 100 |
| Nov 12, 2026 | 101 |
| Nov 11, 2026 | 96 |
| Nov 10, 2026 | 100 |
| Nov 9, 2026 | 102 |
| Nov 8, 2026 | 44 |
| Nov 7, 2026 | 61 |
| Nov 6, 2026 | 60 |
| Nov 5, 2026 | 53 |
| Nov 4, 2026 | 78 |
| Nov 3, 2026 | 73 |
| Nov 2, 2026 | 75 |
| Nov 1, 2026 | 76 |
| Oct 31, 2026 | 47 |
| Oct 30, 2026 | 32 |
| Oct 29, 2026 | 32 |
| Oct 28, 2026 | 7 |
| Oct 27, 2026 | 9 |
| Oct 26, 2026 | 5 |
| Oct 25, 2026 | 5 |
| Oct 24, 2026 | 6 |
| Oct 23, 2026 | 6 |
| Oct 22, 2026 | 7 |
| Oct 21, 2026 | 7 |
| Oct 20, 2026 | 5 |
| Oct 19, 2026 | 4 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 4 |
| Oct 15, 2026 | 8 |
| Oct 14, 2026 | 10 |
| Oct 13, 2026 | 10 |
| Oct 12, 2026 | 10 |
| Oct 11, 2026 | 11 |
| Oct 10, 2026 | 10 |
| Oct 9, 2026 | 8 |
| Oct 8, 2026 | 3 |
| Oct 7, 2026 | 1 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 3 |
| Oct 3, 2026 | 4 |
| Oct 2, 2026 | 8 |
| Oct 1, 2026 | 9 |
| Sep 30, 2026 | 9 |
| Sep 29, 2026 | 10 |
| Sep 28, 2026 | 10 |
| Sep 27, 2026 | 12 |
| Sep 26, 2026 | 18 |
| Sep 25, 2026 | 16 |
| Sep 24, 2026 | 15 |
| Sep 23, 2026 | 17 |
| Sep 22, 2026 | 17 |
| Sep 21, 2026 | 18 |
| Sep 20, 2026 | 15 |
| Sep 19, 2026 | 8 |
| Sep 18, 2026 | 9 |
| Sep 17, 2026 | 12 |
| Sep 16, 2026 | 11 |
| Sep 15, 2026 | 9 |
| Sep 14, 2026 | 10 |
| Sep 13, 2026 | 9 |
| Sep 12, 2026 | 14 |
| Sep 11, 2026 | 11 |
| Sep 10, 2026 | 8 |
| Sep 9, 2026 | 9 |
| Sep 8, 2026 | 9 |
| Sep 7, 2026 | 9 |
| Sep 6, 2026 | 9 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/782753635-root)<a href="https://payloaddirectory.dev/plugins/782753635-root"><img src="https://payloaddirectory.dev/badge/782753635-root.svg" alt="Payload Directory"></a>README
SFTP adapter for Payload CMS's plugin-cloud-storage plugin
This adapter uses ssh2-sftp-client to handle the SSH connection and SFTP operations.
Let's say we have a Videos collection (which slug is "videos") and we want to store the uploads on a third-party remote storage using SFTP.
At the top of your payload.config.ts file, add the following:
import { sftpAdapter } from "payloadcms-sftp-storage";
Then within the buildConfig add the following:
plugins: [
cloudStorage({
collections: {
videos: {
adapter: sftpAdapter({
connectOptions: {
host: "domain.com",
username: "userName",
privateKey: process.env.SFTP_PRIVATE_KEY, // See bellow how to add a privatekey in .env file
passphrase: 'a pass phrase for the private key'
// Instead of a private key you can also use a password:
// password: "mypassword",
// You may set a custom port (default: 22)
// port: 2207,
},
destinationPathRoot: "/absolute/path/to/destination/root/folder",
publicEndpoint: "https://domain.com",
}),
disableLocalStorage: true,
disablePayloadAccessControl: true,
},
},
}),
],
If we upload a video file name "my-video.mp4", the file will be uploaded at destinationPathRoot, in a subfolder named "videos" (because this is the slug of the collection) as a file with the same name as the original "my-video.mp4". In this example, the path of the transfered file will be /absolute/path/to/destination/root/folder/videos/my-video.mp4, and its public address will be https://domain.com/videos/my-video.mp4
Beware: when deleting an entry, the file will also be deleted on the remote storage. Also, if a file "my-video.mp4" already exists, and we try to upload another file with the same name, the original file will be overwritten.
It's a bit tedious to use a private key. You can't use fs within PayloadCMS config file without resorting to some webpack shenanigans. So instead, here's how to store the private key in a .env variable:
Run this command:
echo "SFTP_PRIVATE_KEY=\"`sed -E 's/$/\\\n/g' /path/to/my_private_key`\"" >> /path/to/.env
Then open your .env file and edit the variable into a single line.
Tags
payload nextcloud
Nextcloud storage adapter for Payload uploads over WebDAV with optional public share links
334/wk2v3
cloud storage
Store Payload uploads in third-party cloud storage through a generic adapter interface
1001.0M/wk46.1kv3 v4
payload storage bunny
Storage adapter for with video streaming, signed URLs and CDN cache purging
753.9k/wk60v4
payload storage sanity
Store Payload media uploads in Sanity Content Lake with crops, focal points and video posters
721.2k/wk0v3
payload storage cloudinary
Cloudinary storage adapter for Payload uploads with transformation presets, dynamic folders and private signed files
58176/wk7v3
payload s3 upload
Send Payload CMS uploads and resized image variants to Amazon S3 with per-collection configuration
48244/wk70v1