summaryrefslogtreecommitdiffstats
path: root/docs/installation.rst
blob: edfb0edc0bb89b1897be61f2cd96b146f33fde52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
.. include:: global.rst.inc
.. _installation:

Installation
============

|project_name| pyinstaller binary installation requires:

* Linux: glibc >= 2.13 (ok for most supported Linux releases)
* MacOS X: 10.10 (unknown whether it works for older releases)
* FreeBSD: 10.2 (unknown whether it works for older releases)

|project_name| non-binary installation requires:

* Python_ >= 3.2.2
* OpenSSL_ >= 1.0.0
* libacl_ (that pulls in libattr_ also)
* liblz4_
* some python dependencies, see install_requires in setup.py

General notes
-------------
You need to do some platform specific preparation steps (to install libraries
and tools) followed by the generic installation of |project_name| itself:

Below, we describe different ways to install |project_name|.

- **dist package** - easy and fast, needs a distribution and platform specific
  binary package (for your Linux/*BSD/OS X/... distribution).
- **pyinstaller binary** - easy and fast, we provide a ready-to-use binary file
  that just works on the supported platforms
- **pypi** - installing a source package from pypi needs more installation steps
  and will need a compiler, development headers, etc..
- **git** - for developers and power users who want to have the latest code or
  use revision control (each release is tagged).

**Python 3**: Even though this is not the default Python version on many systems,
it is usually available as an optional install.

Virtualenv_ can be used to build and install |project_name| without affecting
the system Python or requiring root access.

Important:
If you install into a virtual environment, you need to **activate**
the virtual env first (``source borg-env/bin/activate``).
Alternatively, directly run ``borg-env/bin/borg`` (or symlink that into some
directory that is in your PATH so you can just run ``borg``).
Using a virtual environment is optional, but recommended except for the most
simple use cases.

The llfuse_ python package is also required if you wish to mount an
archive as a FUSE filesystem. Only FUSE >= 2.8.0 can support llfuse.

You only need **Cython** to compile the .pyx files to the respective .c files
when using |project_name| code from git. For |project_name| releases, the .c
files will be bundled, so you won't need Cython to install a release.

Platform notes
--------------
FreeBSD: You may need to get a recent enough OpenSSL version from FreeBSD ports.

Mac OS X: You may need to get a recent enough OpenSSL version from homebrew_.

Mac OS X: You need OS X FUSE >= 3.0.


Installation (dist package)
---------------------------
Some Linux, BSD and OS X distributions might offer a ready-to-use
`borgbackup` package (which can be easily installed in the usual way).

As |project_name| is still relatively new, such a package might be not
available for your system yet. Please ask package maintainers to build a
package or, if you can package / submit it yourself, please help us with
that!

If a package is available, it might be interesting for you to check its version
and compare that to our latest release and review the change log (see links on
our web site).


Installation (pyinstaller binary)
---------------------------------
For some platforms we offer a ready-to-use standalone borg binary.

It is supposed to work without requiring installation or preparations.

Check https://github.com/borgbackup/borg/releases for available binaries.


Debian Jessie / Ubuntu 14.04 preparations (git/pypi)
----------------------------------------------------

.. parsed-literal::

    # Python 3.x (>= 3.2) + Headers, Py Package Installer, VirtualEnv
    apt-get install python3 python3-dev python3-pip python-virtualenv

    # we need OpenSSL + Headers for Crypto
    apt-get install libssl-dev openssl

    # ACL support Headers + Library
    apt-get install libacl1-dev libacl1

    # lz4 super fast compression support Headers + Library
    apt-get install liblz4-dev liblz4-1

    # if you do not have gcc / make / etc. yet
    apt-get install build-essential

    # optional: FUSE support - to mount backup archives
    # in case you get complaints about permission denied on /etc/fuse.conf:
    # on ubuntu this means your user is not in the "fuse" group. just add
    # yourself there, log out and log in again.
    apt-get install libfuse-dev fuse pkg-config

    # optional: for unit testing
    apt-get install fakeroot


Korora / Fedora 21 preparations (git/pypi)
------------------------------------------

.. parsed-literal::

    # Python 3.x (>= 3.2) + Headers, Py Package Installer, VirtualEnv
    sudo dnf install python3 python3-devel python3-pip python3-virtualenv

    # we need OpenSSL + Headers for Crypto
    sudo dnf install openssl-devel openssl

    # ACL support Headers + Library
    sudo dnf install libacl-devel libacl

    # lz4 super fast compression support Headers + Library
    sudo dnf install lz4-devel

    # optional: FUSE support - to mount backup archives
    sudo dnf install fuse-devel fuse pkgconfig
    
    # optional: for unit testing
    sudo dnf install fakeroot


Cygwin preparations (git/pypi)
------------------------------

Please note that running under cygwin is rather experimental, stuff has been
tested with CygWin (x86-64) v2.1.0.

You'll need at least (use the cygwin installer to fetch/install these):

::

    python3 python3-setuptools
    python3-cython  # not needed for releases
    binutils gcc-core
    libopenssl openssl-devel
    liblz4_1 liblz4-devel  # from cygwinports.org
    git make openssh

You can then install ``pip`` and ``virtualenv``:

::

    easy_install-3.4 pip
    pip install virtualenv

And now continue with the generic installation (see below).

In case that creation of the virtual env fails, try deleting this file:

::

    /usr/lib/python3.4/__pycache__/platform.cpython-34.pyc


Installation (pypi)
-------------------

This uses the latest (source package) release from PyPi.

.. parsed-literal::

    virtualenv --python=python3 borg-env
    source borg-env/bin/activate   # always before using!

    # install borg + dependencies into virtualenv
    pip install 'llfuse<0.41'  # optional, for FUSE support
                               # 0.41 and 0.41.1 have unicode issues at install time
    pip install borgbackup

Note: we install into a virtual environment here, but this is not a requirement.


Installation (git)
------------------

This uses latest, unreleased development code from git.
While we try not to break master, there are no guarantees on anything.

.. parsed-literal::

    # get |project_name| from github, install it
    git clone |git_url|

    virtualenv --python=python3 borg-env
    source borg-env/bin/activate   # always before using!

    # install borg + dependencies into virtualenv
    pip install sphinx  # optional, to build the docs
    pip install 'llfuse<0.41'  # optional, for FUSE support
                               # 0.41 and 0.41.1 have unicode issues at install time
    cd borg
    pip install -r requirements.d/development.txt
    pip install -e .  # in-place editable mode

    # optional: run all the tests, on all supported Python versions
    fakeroot -u tox

Note: as a developer or power user, you always want to use a virtual environment.