2017-11-18 19:11:14 +01:00
.. _binary releases: https://github.com/zrepl/zrepl/releases
2017-11-09 21:17:09 +01:00
.. _installation:
2017-11-09 20:33:09 +01:00
Installation
============
.. TIP ::
2017-11-10 14:30:51 +01:00
Note: check out the :ref: `tutorial` if you want a first impression of zrepl.
2017-11-09 20:33:09 +01:00
User Privileges
---------------
It is possible to run zrepl as an unprivileged user in combination with
2017-11-09 21:23:45 +01:00
`ZFS delegation <https://www.freebsd.org/doc/handbook/zfs-zfs-allow.html> `_ .
2017-11-09 20:33:09 +01:00
Also, there is the possibility to run it in a jail on FreeBSD by delegating a dataset to the jail.
However, until we get around documenting those setups, you will have to run zrepl as root or experiment yourself :)
2017-11-10 14:30:51 +01:00
Packages
--------
2017-11-18 19:11:14 +01:00
zrepl source releases are signed & tagged by the author in the git repository.
2017-11-10 14:30:51 +01:00
Your OS vendor may provide binary packages of zrepl through the package manager.
2017-11-18 19:11:14 +01:00
Additionally, `binary releases`_ are provided on GitHub.
2017-11-10 14:30:51 +01:00
The following list may be incomplete, feel free to submit a PR with an update:
.. list-table ::
:header-rows: 1
2017-11-09 20:33:09 +01:00
2017-11-10 14:30:51 +01:00
* - OS / Distro
- Install Command
- Link
* - FreeBSD
- `` pkg install zrepl ``
- `<https://www.freshports.org/sysutils/zrepl/>`_
2019-08-15 11:53:26 +02:00
* - MacOS
- `` brew install zrepl ``
- Available on `homebrew <https://brew.sh> `_
2019-10-06 20:06:10 +02:00
* - Arch Linux
2019-10-13 08:31:39 +02:00
- `` yay install zrepl ``
- Available on `AUR <https://aur.archlinux.org/packages/zrepl> `_
2019-10-13 21:05:21 +02:00
* - Fedora
- `` dnf install zrepl ``
- Available on `COPR <https://copr.fedorainfracloud.org/coprs/poettlerric/zrepl/> `_
* - CentOS/RHEL
- `` yum install zrepl ``
- Available on `COPR <https://copr.fedorainfracloud.org/coprs/poettlerric/zrepl/> `_
2019-10-18 19:51:13 +02:00
* - Debian + Ubuntu
- `` apt install zrepl ``
- APT repository config :ref: `see below <installation-apt-repos>`
2019-11-01 13:06:53 +01:00
* - OmniOS
- `` pkg install zrepl ``
- Available since `r151030 <https://pkg.omniosce.org/r151030/extra/en/search.shtml?token=zrepl&action=Search> `_
2019-12-25 13:50:08 +01:00
* - Void Linux
- `` xbps-install zrepl ``
- Available since `a88a2a4 <https://github.com/void-linux/void-packages/commit/a88a2a4d7bf56072dadf61ab56b8424e39155890> `_
2017-11-10 14:30:51 +01:00
* - Others
-
2017-11-18 19:11:14 +01:00
- Use `binary releases`_ or build from source.
2017-11-09 20:33:09 +01:00
2019-10-18 19:51:13 +02:00
.. _installation-apt-repos:
Debian / Ubuntu APT repositories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-10-21 16:35:23 +02:00
We maintain APT repositories for Debian, Ubuntu and derivatives.
The fingerprint of the signing key is `` E101 418F D3D6 FBCB 9D65 A62D 7086 99FC 5F2E BF16 `` .
It is available at `<https://zrepl.cschwarz.com/apt/apt-key.asc>`_ .
Please open an issue `in the packaging repository <https://github.com/zrepl/debian-binary-packaging> `_ if you encounter any issues with the repository.
The following snippet configure the repository for your Debian or Ubuntu release:
2019-10-18 19:51:13 +02:00
::
2019-10-21 16:35:23 +02:00
2019-10-21 11:59:59 +02:00
apt update && apt install curl gnupg lsb-release; \
ARCH="$(dpkg --print-architecture)"; \
CODENAME="$(lsb_release -i -s | tr '[:upper:]' '[:lower:]') $(lsb_release -c -s | tr '[:upper:]' '[:lower:]')"; \
echo "Using Distro and Codename: $CODENAME"; \
(curl https://zrepl.cschwarz.com/apt/apt-key.asc | apt-key add -) && \
(echo "deb [arch=$ARCH] https://zrepl.cschwarz.com/apt/$CODENAME main" > /etc/apt/sources.list.d/zrepl.list) && \
2019-10-18 19:51:13 +02:00
apt update
2019-10-21 16:35:23 +02:00
.. NOTE ::
Until zrepl reaches 1.0, all APT repositories will be updated to the latest zrepl release immediately.
This includes breaking changes between zrepl versions.
Use `` apt-mark hold zrepl `` to prevent upgrades of zrepl.
2019-10-18 19:51:13 +02:00
2017-11-10 14:30:51 +01:00
Compile From Source
~~~~~~~~~~~~~~~~~~~
2019-09-03 14:45:18 +02:00
Producing a release requires **Go 1.11** or newer and **Python 3** + **pip3** + `` docs/requirements.txt `` for the Sphinx documentation.
2017-11-18 19:11:14 +01:00
A tutorial to install Go is available over at `golang.org <https://golang.org/doc/install> `_ .
Python and pip3 should probably be installed via your distro's package manager.
2017-11-12 16:15:12 +01:00
2017-11-18 19:11:14 +01:00
Alternatively, you can use the Docker build process:
it is used to produce the official zrepl `binary releases`_
and serves as a reference for build dependencies and procedure:
2017-11-09 20:33:09 +01:00
::
2020-02-17 17:57:29 +01:00
git clone https://github.com/zrepl/zrepl.git && \
cd zrepl && \
sudo docker build -t zrepl_build -f build.Dockerfile . && \
2017-11-12 16:15:12 +01:00
sudo docker run -it --rm \
2019-09-03 14:45:18 +02:00
-v "${PWD}:/src" \
2017-11-12 16:15:12 +01:00
--user "$(id -u):$(id -g)" \
2019-09-03 14:45:18 +02:00
zrepl_build make release
2017-11-18 19:11:14 +01:00
Alternatively, you can install build dependencies on your local system and then build in your `` $GOPATH `` :
::
mkdir -p "${GOPATH}/src/github.com/zrepl/zrepl"
git clone https://github.com/zrepl/zrepl.git "${GOPATH}/src/github.com/zrepl/zrepl"
cd "${GOPATH}/src/github.com/zrepl/zrepl"
2018-12-01 14:09:32 +01:00
python3 -m venv3
source venv3/bin/activate
2017-11-18 19:11:14 +01:00
./lazy.sh devsetup
2019-09-03 14:45:18 +02:00
make release
2017-11-18 19:11:14 +01:00
2018-12-01 14:09:32 +01:00
The Python venv is used for the documentation build dependencies.
If you just want to build the zrepl binary, leave it out and use `./lazy.sh godep` instead.
Either way, all build results are located in the `` artifacts/ `` directory.
2017-11-12 16:15:12 +01:00
2017-11-18 19:11:14 +01:00
.. NOTE ::
2017-11-12 16:15:12 +01:00
2020-02-23 23:24:12 +01:00
It is your job to install the appropriate binary in the zrepl users's `` $PATH `` , e.g. `` /usr/local/bin/zrepl `` .
2017-11-18 19:11:14 +01:00
Otherwise, the examples in the :ref: `tutorial` may need to be adjusted.
2017-11-09 20:33:09 +01:00
2017-12-27 18:34:02 +01:00
What next?
----------
2017-11-09 20:33:09 +01:00
2019-07-26 21:12:21 +02:00
Read the :ref: `configuration chapter<configuration_toc>` and then continue with the :ref: `usage chapter<usage>` .
2017-11-09 20:33:09 +01:00
2017-12-27 18:34:02 +01:00
**Reminder** : If you want a quick introduction, please read the :ref: `tutorial` .