Skip to content

Storage and SFTP

A file space for each project, separate from its versions: images, visitor uploads and large files that stay when you publish. Reach it from the API, the CLI, the dashboard or SFTP.

On this page

Storage and versions

Version files never change and arrive with a publish. Storage is living data: files there stay in place when a new version goes live. Files are addressed by path, and every path starts with one of two folders:

FolderWho can open it
public/Everyone, at https://<project>.perafly.app/_files/<path after public/>. This stays public even when the project is private.
private/Only with the secret key or a team credential, or through a download address that lasts 15 minutes.
HTML, scripts, SVG and XML from storage are served as downloads, never as pages: a site is published as a version, not from storage. Keep anything private under private/.

Paths follow the publishing rules (no .., at most 512 characters). Range requests are supported. Projects published without an account have no storage.

From the terminal

Terminal
perafly storage ls public/images/
perafly storage put ./hero.jpg public/images/        # a path ending in / keeps the file name
perafly storage get private/exports/2026-11.csv ./exports/
perafly storage mv public/old/ public/new/            # --overwrite replaces existing files
perafly storage rm public/tmp/ --yes                  # a path ending in / is a folder
perafly storage sync ./media public/media --dry-run
  • sync uploads files that are missing or differ in size, and deletes nothing.
  • mv and rm work on a folder when the path ends with / (at most 1,000 files).
  • Local files follow the publishing exclusions: .env*, keys, .git and node_modules are never uploaded.

With the API

Uploading is two steps: ask for an upload address, then send the bytes to it. Upload addresses last one hour and the body must be exactly the declared size. Uploading over an existing path replaces the file.

Terminal
curl https://api.perafly.com/v1/projects/my-site/storage/uploads \
  -H "Authorization: Bearer $PERAFLY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "path": "public/images/hero.jpg", "size": 182934, "contentType": "image/jpeg" }'

curl -X PUT --data-binary @hero.jpg "<uploadUrl>"

The secret key (pfk_…) can use storage for its own project, so a server app can store visitor uploads. Listing, downloading, moving and deleting are in the API reference.

Limits

Total storage is counted for the whole team; the size of one file and the number of SFTP accounts per project also come from your plan (see Pricing). When storage is full, uploads are refused with plan_limit_storage or plan_limit_storage_file; existing files keep being served.

SFTP

Use FileZilla, Cyberduck, WinSCP, sftp or rsync to move files straight into a project's storage. SFTP is on paid plans; there is no plain FTP.

Terminal
perafly sftp add deploy --key ~/.ssh/id_ed25519.pub --folder public/media
perafly sftp ls                      # accounts, the server and port to connect to
perafly sftp rm deploy --yes
OptionMeaning
--key <file.pub>Sign in with an SSH public key (recommended): ed25519, ecdsa or RSA of at least 2048 bits. Only the .pub file is read.
--passwordGenerate a password (pfs_…), shown once.
--readonlyRead and list only.
--folder <folder>Read and write only under this folder, for example public/uploads.
--ip <cidr>Allow sign-in only from this address range; repeatable.
--expires <date>ISO date when the account stops working.
  • An account sees only its own project's storage. There's no shell or port forwarding, only file transfer.
  • The username is <project>.<6 characters> and doesn't change. Perafly checks the account on every sign-in, so a revoked account is out at its next connection.
  • --readonly, --folder and --ip need a plan that includes scoped SFTP accounts.
  • Opening and revoking accounts creates credentials, so it needs a person's full sign-in (owner or admin); agents can't. Sign-ins, uploads and deletes are written to the team's audit log.
  • If the plan stops including SFTP, accounts are suspended, not deleted.