zrok/docs/guides/install/linux.mdx

136 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

---
title: Install zrok in Linux
sidebar_label: Linux
---
2023-11-23 05:21:28 +01:00
import { AssetsProvider } from '@site/src/components/assets-context';
import DownloadCard from '@site/src/components/download-card';
import styles from '@site/src/css/download-card.module.css';
2023-11-28 21:28:46 +01:00
import AnsibleRepoSetup from './_ansible_repo_setup.yaml'
import ConcatenateYamlSnippets from '@site/src/components/cat-yaml.jsx'
2025-02-20 14:59:24 +01:00
import Homebrew from './_homebrew.mdx';
## Install `zrok` from the Repository
This will configure the system to receive DEB or RPM package updates.
```text
curl -sSf https://get.openziti.io/install.bash | sudo bash -s zrok
```
:::info
Check out [zrok frontdoor](/guides/frontdoor.mdx?os=Linux) for running `zrok` as an always-on service.
:::
<Details>
<summary>Ansible Playbook</summary>
<ConcatenateYamlSnippets
title="Set up package repository and install zrok">
{AnsibleRepoSetup}
{`
- name: Install zrok package
gather_facts: false
hosts: all
become: true
tasks:
- name: Install zrok
ansible.builtin.package:
name: zrok
state: present
`}
</ConcatenateYamlSnippets>
</Details>
## Homebrew
<Homebrew />
2023-11-23 05:21:28 +01:00
## Linux Binary
2023-11-23 05:21:28 +01:00
<AssetsProvider>
<div className={styles.downloadContainer}>
<DownloadCard
osName="Linux"
osLogo="/img/logo-linux.svg"
/>
</div>
</AssetsProvider>
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.
<Details>
<summary>Manually install in `~/bin/zrok`</summary>
1. Unarchive the distribution in a temporary directory.
```text
mkdir /tmp/zrok && tar -xf ./zrok*linux*.tar.gz -C /tmp/zrok
```
1. Install the `zrok` executable.
```text
mkdir -p ~/bin && install /tmp/zrok/zrok ~/bin/
```
1. Add `~/bin` to your shell's executable search path. Optionally add this to your ~/.zshenv to persist the change.
```text
PATH=~/bin:$PATH
```
1. With the `zrok` executable in your path, you can then execute the `zrok` command from your shell:
```text
zrok version
```
```buttonless title="Output"
_
_____ __ ___ | | __
|_ / '__/ _ \| |/ /
/ /| | | (_) | <
/___|_| \___/|_|\_\
v0.4.0 [c889005]
```
</Details>
<Details>
2023-11-28 21:28:46 +01:00
<summary>Script to install binary in `/usr/local/bin/zrok`</summary>
This script auto-selects the correct architecture and may be helpful for Raspberry Pi users.
```text
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
;;
2024-11-02 00:01:43 +01:00
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;
```
2025-02-20 14:59:24 +01:00
</Details>