Skip to content

Instantly share code, notes, and snippets.

@lwillek
Last active January 30, 2025 16:08
Show Gist options
  • Save lwillek/20143533c081c977c78db1d3952d73fc to your computer and use it in GitHub Desktop.
Save lwillek/20143533c081c977c78db1d3952d73fc to your computer and use it in GitHub Desktop.
gocryptfs installation on MacOS

gocryptfs on MacOS - manual installation

To install gocryptfs, macFUSE is required, which relies on a license not accepted by Homebrew. This is why the upgrade command refuses to work. Installing or updating via homebrew fails for this reason. Here you learn how to manually install and update gocryptfs.

precondition

As precondition, ensure you have Xcode, git and the "Go" programming language installed:

xcode-select --install
brew install go
brew install git

Remove any old version of gocryptfs via brew uninstall gocryptfs.

Update or install macFUSE, either by downloading it from macfuse.io or using the homebrew command:

brew install macfuse

You need to allow the macFUSE system extension within the "Security & Privacy" system setting and restart your Mac.

manual installation

Then, download the gocryptfs source code and compile:

git clone https://github.com/rfjakob/gocryptfs.git
cd gocryptfs
./build-without-openssl.bash

The command compiles and installs gocryptfs into the directory ~/go/bin. To be able to access gocryptfs directly in the terminal, add the folder in which the tool is installed to the search path. This can be achieved with echo -n 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc.

automation

In case you mount your encrypted directories automatically with an Automator workflow or a LaunchAgent, you need to change the absolute path /usr/local/bin/gocryptfs to /Users/<NAME>/go/bin/gocryptfs. Replace <NAME> with the folder name of your account. You can also find out the correct path by typing which goctyptfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment