installation.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. .. include:: global.rst.inc
  2. .. highlight:: bash
  3. .. _installation:
  4. Installation
  5. ============
  6. There are different ways to install |project_name|:
  7. - :ref:`distribution-package` - easy and fast if a package is
  8. available from your distribution.
  9. - :ref:`pyinstaller-binary` - easy and fast, we provide a ready-to-use binary file
  10. that comes bundled with all dependencies.
  11. - :ref:`source-install`, either:
  12. - :ref:`pip-installation` - installing a source package with pip needs
  13. more installation steps and requires all dependencies with
  14. development headers and a compiler.
  15. - :ref:`git-installation` - for developers and power users who want to
  16. have the latest code or use revision control (each release is
  17. tagged).
  18. .. _distribution-package:
  19. Distribution Package
  20. --------------------
  21. Some distributions might offer a ready-to-use ``borgbackup``
  22. package which can be installed with the package manager. As |project_name| is
  23. still a young project, such a package might be not available for your system
  24. yet.
  25. ============ ============================================= =======
  26. Distribution Source Command
  27. ============ ============================================= =======
  28. Arch Linux `[community]`_ ``pacman -S borg``
  29. Debian `Debian packages`_ ``apt install borgbackup``
  30. Gentoo `ebuild`_ ``emerge borgbackup``
  31. GNU Guix `GNU Guix`_ ``guix package --install borg``
  32. Fedora/RHEL `Fedora official repository`_ ``dnf install borgbackup``
  33. FreeBSD `FreeBSD ports`_ ``cd /usr/ports/archivers/py-borgbackup && make install clean``
  34. Mageia `cauldron`_ ``urpmi borgbackup``
  35. NetBSD `pkgsrc`_ ``pkg_add py-borgbackup``
  36. NixOS `.nix file`_ N/A
  37. OS X `Brew cask`_ ``brew cask install borgbackup``
  38. Raspbian `Raspbian testing`_ ``apt install borgbackup``
  39. Ubuntu `Ubuntu packages`_, `Ubuntu PPA`_ ``apt install borgbackup``
  40. ============ ============================================= =======
  41. .. _[community]: https://www.archlinux.org/packages/?name=borg
  42. .. _Debian packages: https://packages.debian.org/search?keywords=borgbackup&searchon=names&exact=1&suite=all&section=all
  43. .. _Fedora official repository: https://apps.fedoraproject.org/packages/borgbackup
  44. .. _FreeBSD ports: http://www.freshports.org/archivers/py-borgbackup/
  45. .. _ebuild: https://packages.gentoo.org/packages/app-backup/borgbackup
  46. .. _GNU Guix: https://www.gnu.org/software/guix/package-list.html#borg
  47. .. _pkgsrc: http://pkgsrc.se/sysutils/py-borgbackup
  48. .. _cauldron: http://madb.mageia.org/package/show/application/0/release/cauldron/name/borgbackup
  49. .. _Xenial 16.04: https://launchpad.net/ubuntu/xenial/+source/borgbackup
  50. .. _Wily 15.10 (backport PPA): https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/borgbackup
  51. .. _Trusty 14.04 (backport PPA): https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/borgbackup
  52. .. _.nix file: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/backup/borg/default.nix
  53. .. _Brew cask: https://caskroom.github.io/
  54. .. _Raspbian testing: http://archive.raspbian.org/raspbian/pool/main/b/borgbackup/
  55. .. _Ubuntu packages: http://packages.ubuntu.com/xenial/borgbackup
  56. .. _Ubuntu PPA: https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/borgbackup
  57. Please ask package maintainers to build a package or, if you can package /
  58. submit it yourself, please help us with that! See :issue:`105` on
  59. github to followup on packaging efforts.
  60. If a package is available, it might be interesting to check its version
  61. and compare that to our latest release and review the :doc:`changes`.
  62. .. _pyinstaller-binary:
  63. Standalone Binary
  64. -----------------
  65. .. note:: Releases are signed with an OpenPGP key, see
  66. :ref:`security-contact` for more instructions.
  67. |project_name| binaries (generated with `pyinstaller`_) are available
  68. on the releases_ page for the following platforms:
  69. * **Linux**: glibc >= 2.13 (ok for most supported Linux releases). Maybe older
  70. glibc versions also work, if they are compatible to 2.13.
  71. * **Mac OS X**: 10.10 (does not work with older OS X releases)
  72. * **FreeBSD**: 10.2 (unknown whether it works for older releases)
  73. To install such a binary, just drop it into a directory in your ``PATH``,
  74. make borg readable and executable for its users and then you can run ``borg``::
  75. sudo cp borg-linux64 /usr/local/bin/borg
  76. sudo chown root:root /usr/local/bin/borg
  77. sudo chmod 755 /usr/local/bin/borg
  78. Note that the binary uses /tmp to unpack |project_name| with all dependencies.
  79. It will fail if /tmp has not enough free space or is mounted with the ``noexec`` option.
  80. You can change the temporary directory by setting the ``TEMP`` environment variable before running |project_name|.
  81. If a new version is released, you will have to manually download it and replace
  82. the old version using the same steps as shown above.
  83. .. _pyinstaller: http://www.pyinstaller.org
  84. .. _releases: https://github.com/borgbackup/borg/releases
  85. .. _platforms:
  86. Features & platforms
  87. --------------------
  88. Besides regular file and directory structures, |project_name| can preserve
  89. * Hardlinks (considering all files in the same archive)
  90. * Symlinks (stored as symlink, the symlink is not followed)
  91. * Special files:
  92. * Character and block device files (restored via mknod)
  93. * FIFOs ("named pipes")
  94. * Special file *contents* can be backed up in ``--read-special`` mode.
  95. By default the metadata to create them with mknod(2), mkfifo(2) etc. is stored.
  96. * Timestamps in nanosecond precision: mtime, atime, ctime
  97. * Permissions:
  98. * IDs of owning user and owning group
  99. * Names of owning user and owning group (if the IDs can be resolved)
  100. * Unix Mode/Permissions (u/g/o permissions, suid, sgid, sticky)
  101. On some platforms additional features are supported:
  102. .. Yes/No's are grouped by reason/mechanism/reference.
  103. +------------------+----------+-----------+------------+
  104. | Platform | ACLs | xattr | Flags |
  105. | | [#acls]_ | [#xattr]_ | [#flags]_ |
  106. +==================+==========+===========+============+
  107. | Linux x86 | Yes | Yes | No |
  108. +------------------+ | | |
  109. | Linux PowerPC | | | |
  110. +------------------+ | | |
  111. | Linux ARM | | | |
  112. +------------------+----------+-----------+------------+
  113. | Mac OS X | Yes | Yes | Yes (all) |
  114. +------------------+----------+-----------+ |
  115. | FreeBSD | Yes | Yes | |
  116. +------------------+----------+-----------+ |
  117. | OpenBSD | n/a | n/a | |
  118. +------------------+----------+-----------+ |
  119. | NetBSD | n/a | No [2]_ | |
  120. +------------------+----------+-----------+------------+
  121. | Solaris 11 | No [3]_ | n/a |
  122. +------------------+ | |
  123. | OpenIndiana | | |
  124. +------------------+----------+-----------+------------+
  125. | Windows (cygwin) | No [4]_ | No | No |
  126. +------------------+----------+-----------+------------+
  127. Some Distributions (e.g. Debian) run additional tests after each release, these
  128. are not reflected here.
  129. Other Unix-like operating systems may work as well, but have not been tested at all.
  130. Note that most of the platform-dependent features also depend on the file system.
  131. For example, ntfs-3g on Linux isn't able to convey NTFS ACLs.
  132. .. [2] Feature request :issue:`1332`
  133. .. [3] Feature request :issue:`1337`
  134. .. [4] Cygwin tries to map NTFS ACLs to permissions with varying degress of success.
  135. .. [#acls] The native access control list mechanism of the OS. This normally limits access to
  136. non-native ACLs. For example, NTFS ACLs aren't completely accessible on Linux with ntfs-3g.
  137. .. [#xattr] extended attributes; key-value pairs attached to a file, mainly used by the OS.
  138. This includes resource forks on Mac OS X.
  139. .. [#flags] aka *BSD flags*.
  140. .. _source-install:
  141. From Source
  142. -----------
  143. Dependencies
  144. ~~~~~~~~~~~~
  145. To install |project_name| from a source package (including pip), you have to install the
  146. following dependencies first:
  147. * `Python 3`_ >= 3.4.0, plus development headers. Even though Python 3 is not
  148. the default Python version on most systems, it is usually available as an
  149. optional install.
  150. * OpenSSL_ >= 1.0.0, plus development headers.
  151. * libacl_ (that pulls in libattr_ also), both plus development headers.
  152. * liblz4_, plus development headers.
  153. * some Python dependencies, pip will automatically install them for you
  154. * optionally, the llfuse_ Python package is required if you wish to mount an
  155. archive as a FUSE filesystem. See setup.py about the version requirements.
  156. If you have troubles finding the right package names, have a look at the
  157. distribution specific sections below and also at the Vagrantfile in our repo.
  158. In the following, the steps needed to install the dependencies are listed for a
  159. selection of platforms. If your distribution is not covered by these
  160. instructions, try to use your package manager to install the dependencies. On
  161. FreeBSD, you may need to get a recent enough OpenSSL version from FreeBSD
  162. ports.
  163. After you have installed the dependencies, you can proceed with steps outlined
  164. under :ref:`pip-installation`.
  165. Debian / Ubuntu
  166. +++++++++++++++
  167. Install the dependencies with development headers::
  168. sudo apt-get install python3 python3-dev python3-pip python-virtualenv \
  169. libssl-dev openssl \
  170. libacl1-dev libacl1 \
  171. liblz4-dev liblz4-1 \
  172. build-essential
  173. sudo apt-get install libfuse-dev fuse pkg-config # optional, for FUSE support
  174. In case you get complaints about permission denied on ``/etc/fuse.conf``: on
  175. Ubuntu this means your user is not in the ``fuse`` group. Add yourself to that
  176. group, log out and log in again.
  177. Fedora / Korora
  178. +++++++++++++++
  179. Install the dependencies with development headers::
  180. sudo dnf install python3 python3-devel python3-pip python3-virtualenv
  181. sudo dnf install openssl-devel openssl
  182. sudo dnf install libacl-devel libacl
  183. sudo dnf install lz4-devel
  184. sudo dnf install gcc gcc-c++
  185. sudo dnf install fuse-devel fuse pkgconfig # optional, for FUSE support
  186. Mac OS X
  187. ++++++++
  188. Assuming you have installed homebrew_, the following steps will install all the
  189. dependencies::
  190. brew install python3 lz4 openssl
  191. brew install pkg-config # optional, for FUSE support
  192. pip3 install virtualenv
  193. For FUSE support to mount the backup archives, you need at least version 3.0 of
  194. FUSE for OS X, which is available as a pre-release_.
  195. .. _pre-release: https://github.com/osxfuse/osxfuse/releases
  196. FreeBSD
  197. ++++++++
  198. Listed below are packages you will need to install |project_name|, its dependencies,
  199. and commands to make fuse work for using the mount command.
  200. ::
  201. pkg install -y python3 openssl liblz4 fusefs-libs pkgconf
  202. pkg install -y git
  203. python3.4 -m ensurepip # to install pip for Python3
  204. To use the mount command:
  205. echo 'fuse_load="YES"' >> /boot/loader.conf
  206. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  207. kldload fuse
  208. sysctl vfs.usermount=1
  209. Windows 10's Linux Subsystem
  210. ++++++++++++++++++++++++++++
  211. .. note::
  212. Running under Windows 10's Linux Subsystem is experimental and has not been tested much yet.
  213. Just follow the Ubuntu Linux installation steps. You can omit the FUSE stuff, it won't work anyway.
  214. Cygwin
  215. ++++++
  216. .. note::
  217. Running under Cygwin is experimental and has only been tested with Cygwin
  218. (x86-64) v2.5.2. Remote repositories are known broken, local repositories should work.
  219. Use the Cygwin installer to install the dependencies::
  220. python3 python3-devel python3-setuptools
  221. binutils gcc-g++
  222. libopenssl openssl-devel
  223. liblz4_1 liblz4-devel
  224. git make openssh
  225. You can then install ``pip`` and ``virtualenv``::
  226. easy_install-3.4 pip
  227. pip install virtualenv
  228. .. _pip-installation:
  229. Using pip
  230. ~~~~~~~~~
  231. Virtualenv_ can be used to build and install |project_name| without affecting
  232. the system Python or requiring root access. Using a virtual environment is
  233. optional, but recommended except for the most simple use cases.
  234. .. note::
  235. If you install into a virtual environment, you need to **activate** it
  236. first (``source borg-env/bin/activate``), before running ``borg``.
  237. Alternatively, symlink ``borg-env/bin/borg`` into some directory that is in
  238. your ``PATH`` so you can just run ``borg``.
  239. This will use ``pip`` to install the latest release from PyPi::
  240. virtualenv --python=python3 borg-env
  241. source borg-env/bin/activate
  242. # install Borg + Python dependencies into virtualenv
  243. pip install borgbackup
  244. # or alternatively (if you want FUSE support):
  245. pip install borgbackup[fuse]
  246. To upgrade |project_name| to a new version later, run the following after
  247. activating your virtual environment::
  248. pip install -U borgbackup # or ... borgbackup[fuse]
  249. .. _git-installation:
  250. Using git
  251. ~~~~~~~~~
  252. This uses latest, unreleased development code from git.
  253. While we try not to break master, there are no guarantees on anything. ::
  254. # get borg from github
  255. git clone https://github.com/borgbackup/borg.git
  256. virtualenv --python=python3 borg-env
  257. source borg-env/bin/activate # always before using!
  258. # install borg + dependencies into virtualenv
  259. pip install sphinx # optional, to build the docs
  260. cd borg
  261. pip install -r requirements.d/development.txt
  262. pip install -r requirements.d/fuse.txt # optional, for FUSE support
  263. pip install -e . # in-place editable mode
  264. # optional: run all the tests, on all supported Python versions
  265. # requires fakeroot, available through your package manager
  266. fakeroot -u tox
  267. .. note:: As a developer or power user, you always want to use a virtual environment.