Skip to content

Use Magic Wormhole to transfer files

Page last updated on: 2019-10-14

Magic wormhole is a simple and safe way to transfer files/folders between computers, even when computers are behind firewalls.

It works by letting two computers negotiate an open port on each side and transfer files encrypted. The negotiation is through a central server and authenticated by a secret code. Only the parties that know this secret code will be able make connection. Since the secret code can only be used once and it is short lived, the chance of the code being guessed is small.


  • On computer 1:

wormhole send file_or_folder
It will generate a code_created_by_computer1 in format of number-word1-word2.

  • On computer 2:
wormhole receive code_created_by_computer1


Computer 1 - sender
wormhole transfer

Computer 2 - receiver
wormhole transfer



Use apt (Debian and Ubuntu):

$ sudo apt install magic-wormhole

Or use snap package:

$ sudo snap install wormhole


Use Homebrew:

brew install magic-wormhole

Or use pip:

$ pip install magic-wormhole


Save the code in file install_wormhole.bat, and run in cmd window as administrator.

:: This script installs wormhole ( and
:: its prerequisites. Run this as an administrator.

:: Install chocolatey.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(''))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

:: Install Python 3.
choco install -y python

:: Install Microsoft Visual C++ Build Tools 2015.
choco install -y vcbuildtools

:: Refresh environment variables so that we can call Python (this is not a 
:: native shell command: it is a script installed as part of chocolatey).
call RefreshEnv

:: Install wormhole.
pip install magic-wormhole

Last update: 2019-10-14