croc is a command-line tool for transferring files and folders between two computers. It uses a relay server so you don't need port-forwarding or a public IP, and it encrypts transfers end-to-end using password-authenticated key agreement (PAKE). It's built for developers, sysadmins, and anyone who needs a quick, secure way to move files between machines without setting up a local server or relying on cloud storage.
croc fits well when you need to move a file or folder between two machines quickly, without configuring a server, opening firewall ports, or uploading to a third-party cloud service. It works well for transferring files between a laptop and a remote server, sharing files across different operating systems, or sending files to someone on another network entirely (using the public relay).
It's also useful for scripted or automated transfers thanks to stdin/stdout piping and a quiet mode, and for privacy-conscious users who want to route transfers through Tor via SOCKS5.
It's not the right tool for large-scale, many-to-many file distribution, or for cases needing a persistent file-sync solution (think Dropbox-style continuous sync) since croc is designed for one-off, on-demand transfers between two endpoints. If you need built-in access control beyond a shared code phrase, or centralized file management, look elsewhere.
Download a prebuilt binary from the releases page, or install via a package manager for your platform.
Quick install script (Linux/macOS):
curl https://getcroc.schollz.com | bash
macOS (Homebrew):
brew install croc
Windows (Scoop):
scoop install croc
Arch Linux:
pacman -S croc
Fedora:
dnf install croc
Build from source (requires Go 1.22+):
go install github.com/schollz/croc/v10@latest
Docker (runs within the current directory):
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 "$@"; }
Once installed, sending a file looks like this:
croc send [file-or-folder]
This prints a code phrase. On the receiving computer, run:
croc code-phrase
On Linux and macOS, pass the secret as an environment variable to avoid leaking it via the process list:
CROC_SECRET=*** croc
You can also self-host a relay instead of using the public one:
croc relay
and point senders/receivers to it with --relay "myrelay.example.com:9009".