Install zrok in Linux
Linux Binary
Linux
Download the binary distribution for your Linux distribution's architecture or run the install script below to pick the correct CPU architecture automatically. For Intel and AMD 64-bit machines use the amd64
distribution. For Raspberry Pi use the arm64
distribution.
Manually install in ~/bin/zrok
-
Unarchive the distribution in a temporary directory.
mkdir /tmp/zrok && tar -xf ./zrok*linux*.tar.gz -C /tmp/zrok
-
Install the
zrok
executable.mkdir -p ~/bin && install /tmp/zrok/zrok ~/bin/
-
Add
~/bin
to your shell's executable search path. Optionally add this to your ~/.zshenv to persist the change.PATH=~/bin:$PATH
-
With the
zrok
executable in your path, you can then execute thezrok
command from your shell:zrok version
Script to install binary in /usr/local/bin/zrok
This script auto-selects the correct architecture and may be helpful for Raspberry Pi users.
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}/zrok_${ZROK_VERSION#v}_linux_${GOXARCH}.tar.gz" \
| tar -xz -f -;
sudo install -o root -g root ./zrok /usr/local/bin/;
zrok version;
Install zrok
from the Repository
We recommend that you install zrok
from the Linux package repository with the manual steps or the setup script. DEB and RPM packages are available for amd64, arm64, and armv7 architectures.
Check out zrok frontdoor for running zrok
as an always-on service.
Manually set up DEB repository
(set -euo pipefail;
curl -sSLf https://get.openziti.io/tun/package-repos.gpg \
| sudo gpg --dearmor --output /usr/share/keyrings/openziti.gpg;
sudo chmod a+r /usr/share/keyrings/openziti.gpg;
sudo tee /etc/apt/sources.list.d/openziti-release.list >/dev/null <<EOF;
deb [signed-by=/usr/share/keyrings/openziti.gpg] https://packages.openziti.org/zitipax-openziti-deb-stable debian main
EOF
sudo apt update;
sudo apt install zrok;
zrok version;
)
Manually set up RPM repository
(set -euo pipefail;
sudo tee /etc/yum.repos.d/openziti-release.repo >/dev/null <<\EOF;
[OpenZitiRelease]
name=OpenZiti Release
baseurl=https://packages.openziti.org/zitipax-openziti-rpm-stable/redhat/$basearch
enabled=1
gpgcheck=0
gpgkey=https://packages.openziti.org/zitipax-openziti-rpm-stable/redhat/$basearch/repodata/repomd.xml.key
repo_gpgcheck=1
EOF
sudo dnf update;
sudo dnf install zrok;
zrok version;
)
Script to set up DEB or RPM repository
-
Download the zrok install script.
curl -sSLfo ./zrok-install.bash https://get.openziti.io/install.bash
-
Inspect the script to ensure it is suitable to run as root on your system.
less ./zrok-install.bash
-
Run the script as root to add the package repo and install the
zrok
package.sudo bash ./zrok-install.bash zrok
Ansible Playbook
- 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 zrok package
gather_facts: false
hosts: all
become: true
tasks:
- name: Install zrok
ansible.builtin.package:
name: zrok
state: present