Skip to main content
Star zrok on GitHub Star
Version: 2.0 (Current)

Install zrok on Linux

Choose the install method that fits your setup. For most Linux users, the package repository method is the simplest.

The RedHat (RPM) and Debian (DEB) packages are maintained by NetFoundry.

  1. Install the package:

    curl -sSf https://get.openziti.io/install.bash | sudo bash -s zrok2
  2. Verify the install:

    zrok2 version
    Output
                   _
    _____ __ ___ | | __
    |_ / '__/ _ \| |/ /
    / /| | | (_) | <
    /___|_| \___/|_|\_\

    v2.0.0 [c889005]
Ansible playbook

Ansible is an automation tool for running tasks across many servers at once. If you're just installing on one machine, skip this and use the curl command above. If you already use Ansible to manage a fleet of hosts, save the YAML below as a playbook file and run it with ansible-playbook.

Set up package repository and install zrok2
- name: Set up zrok Package Repo
gather_facts: true
hosts: all
become: true
tasks:
- name: Set up apt repo
when: ansible_os_family == "Debian"
block:
- name: Install playbook dependencies
ansible.builtin.package:
name:
- gnupg
state: present
- name: Fetch armored pubkey
ansible.builtin.uri:
url: https://get.openziti.io/tun/package-repos.gpg
return_content: 'yes'
register: armored_pubkey
- name: Dearmor pubkey
ansible.builtin.shell: >
gpg --dearmor --output /usr/share/keyrings/openziti.gpg <<< "{{
armored_pubkey.content }}"
args:
creates: /usr/share/keyrings/openziti.gpg
executable: /bin/bash
- name: Set pubkey filemode
ansible.builtin.file:
path: /usr/share/keyrings/openziti.gpg
mode: a+rX
- name: Install OpenZiti repo deb source
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/openziti-release.list
content: >
deb [signed-by=/usr/share/keyrings/openziti.gpg]
https://packages.openziti.org/zitipax-openziti-deb-stable debian
main
- name: Refresh Repo Sources
ansible.builtin.apt:
update_cache: 'yes'
cache_valid_time: 3600
- name: Set up yum repo
when: ansible_os_family == "RedHat"
block:
- name: Install OpenZiti repo rpm source
ansible.builtin.yum_repository:
name: OpenZitiRelease
description: OpenZiti Release
baseurl: >-
https://packages.openziti.org/zitipax-openziti-rpm-stable/redhat/$basearch
enabled: 'yes'
gpgkey: >-
https://packages.openziti.org/zitipax-openziti-rpm-stable/redhat/$basearch/repodata/repomd.xml.key
repo_gpgcheck: 'yes'
gpgcheck: 'no'

- name: Install zrok2 package
gather_facts: false
hosts: all
become: true
tasks:
- name: Install zrok2
ansible.builtin.package:
name: zrok2
state: present

Binary distribution

Use this if you don't have sudo access, can't reach the package repository, or need a specific version.

Manual install

Download the binary for your CPU architecture and follow these steps. Use this if you want to control exactly where the binary goes, inspect what's being installed, or can't run shell scripts. For Intel and AMD 64-bit machines use the amd64 distribution. For Raspberry Pi use the arm64 distribution.

Linux logo

Linux

  1. Unarchive the distribution in a temporary directory:

    mkdir /tmp/zrok2 && tar -xf ./zrok*linux*.tar.gz -C /tmp/zrok2
  2. Install the zrok2 executable:

    mkdir -p ~/bin && install /tmp/zrok2/zrok2 ~/bin/
  3. Add ~/bin to your shell's executable search path. Optionally add this to your ~/.zshenv to persist the change:

    PATH=~/bin:$PATH
  4. Verify the install:

    zrok2 version
    Output
                   _
    _____ __ ___ | | __
    |_ / '__/ _ \| |/ /
    / /| | | (_) | <
    /___|_| \___/|_|\_\

    v2.0.0 [c889005]

Install script

Use this if you want the quickest path to a working binary and don't need to control where it's installed. The script detects your CPU architecture automatically and installs zrok2 to /usr/local/bin/, which requires sudo.

Show script

This script auto-detects your CPU architecture and installs zrok2 to /usr/local/bin/.

cd $(mktemp -d);

ZROK_VERSION=$(
curl -sSf https://api.github.com/repos/openziti/zrok/releases/latest \
| jq -r '.tag_name'
);

case $(uname -m) in
x86_64) GOXARCH=amd64
;;
aarch64|arm64) GOXARCH=arm64
;;
arm*) GOXARCH=armv7
;;
*) echo "ERROR: unknown arch '$(uname -m)'" >&2
exit 1
;;
esac;

curl -sSfL \
"https://github.com/openziti/zrok/releases/download/${ZROK_VERSION}/zrok2_${ZROK_VERSION#v}_linux_${GOXARCH}.tar.gz" \
| tar -xz -f -;

sudo install -o root -g root ./zrok2 /usr/local/bin/;

zrok2 version;
info

To run zrok2 as an always-on service, see the Linux Agent Service guide or the Docker guide.