New to 1Password developer tools?
Follow the developer quickstart to set up the CLI, secure your secrets, and add biometric SSH signing in one guide.
Step 1: Install 1Password CLI
Requirements
Requirements
- Mac
- Windows
- Linux
- 1Password subscription
- 1Password for Mac*
- macOS Big Sur 11.0.0 or later
Supported shells: PowerShell
- 1Password subscription
- 1Password for Linux*
- PolKit*
- A PolKit authentication agent running*
- Mac
- Windows
- Linux
- homebrew
- Manual
-
To install 1Password CLI with homebrew:
brew install 1password-cli -
Check that 1Password CLI installed successfully:
op --version
To manually install 1Password CLI on macOS:
-
Download the latest release of 1Password CLI.
-
- Package file: Open
op.pkgand install 1Password CLI in the default location (usr/local/bin). - ZIP file: Open
op.zipand unzip the file, then moveoptousr/local/bin.
- Package file: Open
-
Check that 1Password CLI was installed successfully:
op --version
- winget
- Manual
-
To install 1Password CLI with winget:
winget install 1password-cli -
Check that 1Password CLI installed successfully:
op --version
To manually install 1Password CLI on Windows:
-
Download the latest release of 1Password CLI and extract
op.exe.
- Open PowerShell as an administrator.
-
Create a folder to move
op.exeinto. For example,C:\Program Files\1Password CLI.mkdir "C:\Program Files\1Password CLI" -
Move the
op.exefile to the new folder.mv ".\op.exe" "C:\Program Files\1Password CLI" -
Add the folder containing the op.exe file to your PATH.
Windows 10 and later- Search for Advanced System Settings in the Start menu.
- Select Environment Variables.
- In the System Variables section, select the PATH environment variable and select Edit.
- In the prompt, select New and add the directory where
op.exeis located. - Sign out and back in to Windows for the change to take effect.
-
Check that 1Password CLI installed successfully:
op --version
$arch = (Get-CimInstance Win32_OperatingSystem).OSArchitecture
switch ($arch) {
'64-bit' { $opArch = 'amd64'; break }
'32-bit' { $opArch = '386'; break }
Default { Write-Error "Sorry, your operating system architecture '$arch' is unsupported" -ErrorAction Stop }
}
$installDir = Join-Path -Path $env:ProgramFiles -ChildPath '1Password CLI'
Invoke-WebRequest -Uri "https://cache.agilebits.com/dist/1P/op2/pkg/v2.39.0/op_windows_$($opArch)_v2.39.0.zip" -OutFile op.zip
Expand-Archive -Path op.zip -DestinationPath $installDir -Force
$envMachinePath = [System.Environment]::GetEnvironmentVariable('PATH','machine')
if ($envMachinePath -split ';' -notcontains $installDir){
[Environment]::SetEnvironmentVariable('PATH', "$envMachinePath;$installDir", 'Machine')
}
Remove-Item -Path op.zip
- APT
- YUM
- Alpine
- NixOS
- Manual
To install 1Password CLI using APT on Debian- and Ubuntu-based distributions:
-
Run the following command:
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \ sudo tee /etc/apt/sources.list.d/1password.list && \ sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ && \ curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \ sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol && \ sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 && \ curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg && \ sudo apt update && sudo apt install 1password-cliSee a step-by-step version of the script
-
Add the key for the 1Password
aptrepository:curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg -
Add the 1Password
aptrepository:echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | sudo tee /etc/apt/sources.list.d/1password.list -
Add the debsig-verify policy:
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \ sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol && \ sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 && \ curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg -
Install 1Password CLI:
sudo apt update && sudo apt install 1password-cli
-
Add the key for the 1Password
-
Check that 1Password CLI installed successfully:
op --version
.deb package directly from one of the following links:To install 1Password CLI using YUM on RPM-based distributions:
-
Run the following commands:
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo' sudo dnf check-update -y 1password-cli && sudo dnf install 1password-cliThe above script is comprised of the following steps
-
Import the public key:
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc -
Configure the repository information:
sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo' -
Install 1Password CLI:
sudo dnf check-update -y 1password-cli && sudo dnf install 1password-cli
-
Import the public key:
-
Check that 1Password CLI installed successfully:
op --version
.rpm package directly from one of the following links:To install 1Password CLI on Alpine x86_64 distributions:
-
Run the following commands:
echo https://downloads.1password.com/linux/alpinelinux/stable/ >> /etc/apk/repositories wget https://downloads.1password.com/linux/keys/alpinelinux/support@1password.com-61ddfc31.rsa.pub -P /etc/apk/keys apk update && apk add 1password-cliThe above script is comprised of the following steps
-
Add Password CLI to your list of repositories:
echo https://downloads.1password.com/linux/alpinelinux/stable/ >> /etc/apk/repositories -
Add the public key to validate the APK to your keys directory:
wget https://downloads.1password.com/linux/keys/alpinelinux/support@1password.com-61ddfc31.rsa.pub -P /etc/apk/keys -
Install 1Password CLI:
apk update && apk add 1password-cli
-
Add Password CLI to your list of repositories:
-
Check that 1Password CLI installed successfully:
op --version
The Nix package is available from the NixOS open source community.
-
Add 1Password to your
/etc/nixos/configuration.nixfile, orflake.nixif you’re using a flake. For example, the following snippet includes 1Password CLI and the 1Password app:# NixOS has built-in modules to enable 1Password # along with some pre-packaged configuration to make # it work nicely. You can search what options exist # in NixOS at https://search.nixos.org/options # Enables the 1Password CLI programs._1password = { enable = true; }; # Enables the 1Password desktop app programs._1password-gui = { enable = true; # this makes system auth etc. work properly polkitPolicyOwners = [ "<your-linux-username>" ]; }; -
After you make changes to your configuration file, apply them:
-
If you added 1Password to
/etc.nixos/configuration.nix, run:sudo nixos-rebuild switch -
If you added 1Password to
flake.nix, replace<flake-directory-path>with the directory your flake is in and<output-name>with the name of the flake output containing your system configuration, then run the command.sudo nixos-rebuild switch --flake <flake-directory-path>.#<output-name>
-
If you added 1Password to
-
Check that 1Password CLI installed successfully:
op --version
To install 1Password CLI on Linux without a package manager:
ARCH="<choose between 386/amd64/arm/arm64>" && \
wget "https://cache.agilebits.com/dist/1P/op2/pkg/v2.39.0/op_linux_${ARCH}_v2.39.0.zip" -O op.zip && \
unzip -d op op.zip && \
sudo mv op/op /usr/local/bin/ && \
rm -r op.zip op && \
sudo groupadd -f onepassword-cli && \
sudo chgrp onepassword-cli /usr/local/bin/op && \
sudo chmod g+s /usr/local/bin/op
Or follow the extended guide
Or follow the extended guide
-
Download the latest release of 1Password CLI and extract it. To verify its authenticity:
gpg --keyserver keyserver.ubuntu.com --receive-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22 gpg --verify op.sig op -
Move
opto/usr/local/bin, or another directory in your$PATH. -
Check that 1Password CLI installed successfully:
op --version -
Create the
onepassword-cligroup if it doesn’t yet exist: