Easily and securely send things from one computer to another :crocodile: :package:
Easily and securely send things from one computer to another :crocodile: :package:
This project’s future depends on community support. Become a sponsor today.
Supporting organizations:
croc is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK, croc is the only CLI file-transfer tool that does all of the following:
For more information about croc, see my blog post or read a recent interview I did.
You can use croc without installing anything at getcroc.com.
The browser version is fully compatible with the CLI, so you can send and receive files between them.
You can download the latest release for your system, or install a release from the command-line:
curl https://getcroc.com | bashWhen the CLI sends or receives a transfer, it checks for a newer croc release at
most once every 24 hours. The check runs in the background and any update notice
is shown after the transfer finishes. Run croc update --check at any time to
check explicitly. Installations made by the command above can use croc update
(croc upgrade is an alias) to verify and install a stable release when the
executable is user-writable; pass --yes to skip confirmation.
Package-managed and other installations are never overwritten; the command
prints the appropriate upgrade guidance instead. Network and release-service
failures in background checks are ignored; --quiet suppresses the notice.
Using Homebrew:
brew install crocUsing MacPorts:
sudo port selfupdate
sudo port install crocYou can install the latest release with Scoop or Chocolatey:
scoop install crocchoco install crocYou can install the latest release with Nix:
nix-env -i crocYou can add this to your configuration.nix:
environment.systemPackages = [
pkgs.croc
];First, install dependencies:
apk add bash coreutils
wget -qO- https://getcroc.com | bashInstall from the pkg.haus APT archive:
# Add the repository (see https://pkg.haus for setup instructions)
sudo apt install crocInstall with pacman:
pacman -S crocInstall with pkg:
pkg install crocInstall with pkg:
pkg install crocYou can install from conda-forge globally with pixi:
pixi global install crocOr install into a particular environment with conda:
conda install --channel conda-forge crocAdd the following one-liner function to your ~/.profile (works with any POSIX-compliant shell):
croc() { [ $# -eq 0 ] && set -- ""; mkdir -p "$HOME/.config/croc"; docker run --rm -it --user "$(id -u):$(id -g)" -v "$(pwd):/c" -v "$HOME/.config/croc:/.config/croc" -w /c -e CROC_SECRET docker.io/schollz/croc "$@"; }You can also just paste it in the terminal for current session. On first run Docker will pull the image. croc via Docker will only work within the current directory and its subdirectories.
If you prefer, you can install Go and build from source (requires Go 1.27+):
go install github.com/schollz/croc/v11@latestThere are F-Droid apps available:
croc binary as its transfer core.Community made desktop apps:
croc binary for drag-and-drop transfers, QR codes, LAN mode, and relay/proxy options.croc on its own normally in order to use. Made to be compact and simple.To send a file, simply do:
$ croc send [file(s)-or-folder]
Sending 'file-or-folder' (X MB)
Code is: code-phraseThen, to receive the file (or folder) on another computer, run:
croc code-phraseThe code phrase is used to establish password-authenticated key agreement (PAKE) which generates a secret key for the sender and recipient to use for end-to-end encryption.
croc sshOn Linux, macOS, FreeBSD, or OpenBSD, start a shared terminal with:
croc sshThe host receives separate six-word invitations for read/write and read-only participants. On Unix, a participant keeps the invitation out of the process list by joining with the command croc prints:
CROC_SECRET='six-word-invitation' croc sshEveryone sees one persistent terminal. Multiple read/write participants may type; read-only participants receive the same output but their input is discarded.
This does not expose an SSH daemon or require an account, public IP, inbound port, or SSH key setup. The invitation authenticates an ephemeral Tailcat WireGuard path and pins an ephemeral SSH host key. Tailcat uses DERP when it cannot establish a direct path; if Tailcat itself is unavailable, the client reauthenticates and carries the pinned SSH stream over the ordinary croc relay. Remote commands, forwarding, and SFTP are disabled. Anyone who receives an invitation has the role printed beside it until the host stops, so treat both invitations as secrets.
See the SSH sharing design and security guide for protocol, reconnection, platform, relay, and threat-model details.
When an immediate peer-to-peer transfer is inconvenient, croc can upload
regular files as client-side encrypted ciphertext:
croc store [file1] [file2]
croc store --downloads 3 --expiration 3d [file1] [file2]
croc store --url https://files.example.com [file1] [file2]The original croc send --store syntax remains supported, with
--store-downloads, --store-expiration, and --store-url settings.
The command prints a browser link and a CLI token. The transfer expires after
the selected lifetime, measured from successful upload completion, or after
its configured number of receivers download, authenticate, and verify every
file—whichever happens first. The lifetime defaults to one day and accepts
whole minutes (m), hours (h), days (d), or weeks (w). The download
limit defaults to one. Both values are subject to server policy. Run croc
with no arguments and paste the token at the prompt to receive it. For
automation, keep the token out of the process list:
CROC_STORE_TOKEN='croc-store-v1....' croc --out ./downloadsThe browser link has the form
https://host/s/id#v1.decryption-key. The decryption key is after # because
URL fragments are not included in HTTP requests, so the storage service gets
the opaque transfer ID but not the key. The full link is still a secret: anyone
who has it can decrypt the files and claim one of the allowed downloads.
While a transfer remains available, its sender can delete it with the locally saved revoke receipt:
croc --revoke [transfer-id]Stored mode is opt-in and separate from croc's normal live relay transfers. A
self-hosted service can be selected with croc store --url (or
croc send --store --store-url) or CROC_STORE_URL.
See the stored-transfer design and operator guide
for protocol, privacy, limits, and deployment details.
croc on Linux or macOSOn Linux and macOS, the sending and receiving process is slightly different to avoid leaking the secret via the process name. You will need to run croc with the secret as an environment variable. For example, to receive with the secret ***:
CROC_SECRET=*** crocFor single-user systems, the default behavior can be permanently enabled by running:
croc --classicYou can send with your own code phrase (must be at least 6 characters):
croc send --code [code-phrase] [file(s)-or-folder]For default public transfers, SHA-256 of the exact code modulo the ordered
three-relay pool determines which deployment both peers use. An automatically
generated sender probes all three relays and generates a normal EFF code that
maps to the first healthy one to respond. A custom code maps directly without probing
or fallback. --relay, CROC_RELAY, --ip, and local-only transfers bypass
this public routing rule. The generated sender caches the winning address in
best-relay alongside croc's other configuration files, then reuses it without
probing. A relay connection failure removes the cache so the following send
measures the pool again; deleting the file also forces a new measurement.
To automatically overwrite files without prompting, use the --overwrite flag:
croc --yes --overwrite <code>To keep an existing file and receive the incoming one under a new name (e.g. video (1).mkv), use the --rename flag:
croc --yes --rename <code>To exclude folders from being sent, use the --exclude flag with comma-delimited exclusions. This does a case-insensitive substring match against each file's relative path, so any path containing one of the given strings anywhere is excluded:
croc send --exclude "node_modules,.venv" [folder]If you need to exclude one specific file rather than every path containing a substring (for example, two files share a name at different depths and only one should be excluded), use --exclude-file instead. It takes comma-delimited relative paths and matches them exactly:
croc send --exclude-file "subfolder/image.jpg" [folder]You can pipe to croc: