Advanced Configuration

Customize installation directory

By default, Krew installs itself and plugins to $HOME/.krew. This means Krew itself and the installed plugins will be visible only to your user.

To customize this installation path, set the KREW_ROOT environment variable while installing Krew. After Krew is installed, you still need to set KREW_ROOT in your environment for Krew to be able to find its installation directory.

For example, add this to your ~/.bashrc or ~/.zshrc file:

export KREW_ROOT="/usr/local/krew"

Note that you still need to add $KREW_ROOT/bin to your PATH variable for kubectl to be able to find installed plugins.

Use a different default index

When Krew is installed, it automatically initializes an index named default pointing to the krew-index repository. You can force Krew to use a different repository by setting KREW_DEFAULT_INDEX_URI before running the installation instructions or after removing the default index. KREW_DEFAULT_INDEX_URI should point to a git repository URI that uses a valid git remote protocol.

To use a different default index, set the KREW_DEFAULT_INDEX_URI environment variable in your ~/.bashrc, ~/.bash_profile, or ~/.zshrc:

export KREW_DEFAULT_INDEX_URI='git@github.com:foo/custom-index.git'
← User Guide