How to Install and Use croc in Linux for Fast and Secure Peer-to-Peer File Transfer

Transferring files between different Linux computers, servers, or across operating systems traditionally involves setting up SSH keys, establishing Samba network shares, uploading to cloud storage, or dealing with fragile netcat pipelines. croc is a modern, open-source command-line tool written in Go that makes transferring files and folders between any two computers completely effortless, requiring only a simple human-readable code phrase while guaranteeing end-to-end PAKE encryption.

Installing croc on Linux Distributions

croc provides native binaries and package repository integration across all major Linux distributions:

  • Universal Quick Script: Install the latest release binary via curl:
    curl https://getcroc.schollz.com | bash
  • Arch Linux: Install from official repositories:
    sudo pacman -S croc
  • Ubuntu and Debian: Available via snap:
    sudo snap install croc
  • Homebrew:
    brew install croc

Sending Files and Directories with a Passphrase

Sending content using croc requires no port forwarding, static IP configuration, or firewall rules. The tool uses a relay server to punch through NAT boundaries:

  1. To send a single file, run:
    croc send report.pdf
  2. To send an entire folder of files:
    croc send /path/to/project_folder/
  3. croc automatically generates a random, memorable four-word code phrase (for example: 7842-amber-galaxy-matrix).
  4. Share this phrase securely with the intended recipient.

Receiving Files on the Destination Machine

On the receiving computer (which can be running Linux, macOS, or Windows):

  • Open a terminal and run the command followed by the shared code phrase:
    croc 7842-amber-galaxy-matrix
  • croc displays the file name, total size, and prompts with a confirmation prompt asking if you wish to accept the incoming transfer.
  • Press y to begin downloading. Transfers resume automatically if interrupted by a network drop.

Security and Custom Relays

All communication through croc uses Password Authenticated Key Exchange (PAKE) with ephemeral elliptic curve keys, ensuring that intermediate relay servers cannot decrypt file payloads. Organisations requiring strict internal compliance can easily host private self-hosted relay servers using croc relay.

Leveraging croc simplifies ad-hoc terminal transfers, providing unparalleled speed and security without the overhead of complex remote server configurations.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.