Favicon of Croc

Croc

croc is a Go CLI tool for secure, cross-platform peer-to-peer file transfer using PAKE encryption and a relay server.

Open Source Alternative to:
Croc GitHub repository preview

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.

Key features

  • End-to-end encryption: Uses PAKE to derive a shared secret from a code phrase, so no keys are exchanged in the clear.
  • Cross-platform: Works on Windows, Linux, macOS, and Android (via a third-party F-Droid app).
  • No server setup required: A public relay handles connection brokering; you can also self-host your own relay.
  • Resumable transfers: Interrupted transfers can pick up where they left off.
  • Multiple file and folder support: Send several files and folders in a single command.
  • IPv6-first with IPv4 fallback: Prefers IPv6 but falls back automatically.
  • Proxy support: Can route traffic through a SOCKS5 proxy, including Tor.
  • Pipe support: Works with stdin/stdout for scripting and automation.
  • QR code sharing: Generates a QR code for easy mobile-to-desktop transfers.
  • Custom code phrases: Set your own memorable code instead of the auto-generated one.

Ideal use cases

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.

Installation

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".

Frequently asked questions

Share:

Stars
38.7K
Forks
1.5K
Last commit
24 hours ago
Repository age
9 years
License
MIT
Self-hosted
No
Activity score
83/100
View Repository
Ad
Favicon

 

  
 

Similar to Croc

Favicon

 

  
 
Favicon

 

  
 
Favicon