You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

from-binary.en-us.md 2.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. date: "2017-06-19T12:00:00+02:00"
  3. title: "Installation from binary"
  4. slug: "install-from-binary"
  5. weight: 10
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "installation"
  11. name: "From binary"
  12. weight: 20
  13. identifier: "install-from-binary"
  14. ---
  15. # Installation from binary
  16. All downloads come with SQLite, MySQL and PostgreSQL support, and are built with
  17. embedded assets. This can be different for older releases. Choose the file matching
  18. the destination platform from the [downloads page](https://dl.gitea.io/gitea), copy
  19. the URL and replace the URL within the commands below:
  20. ```sh
  21. wget -O gitea https://dl.gitea.io/gitea/1.4.2/gitea-1.4.2-linux-amd64
  22. chmod +x gitea
  23. ```
  24. ## Test
  25. After getting a binary, it can be tested with `./gitea web` or moved to a permanent
  26. location. When launched manually, Gitea can be killed using `Ctrl+C`.
  27. ```
  28. ./gitea web
  29. ```
  30. ## Recommended server configuration
  31. ### Prepare environment
  32. Check that git is installed on the server, if it is not install it first.
  33. ```sh
  34. git --version
  35. ```
  36. Create user to run gitea (ex. `git`)
  37. ```sh
  38. adduser \
  39. --system \
  40. --shell /bin/bash \
  41. --gecos 'Git Version Control' \
  42. --group \
  43. --disabled-password \
  44. --home /home/git \
  45. git
  46. ```
  47. ### Create required directory structure
  48. ```sh
  49. mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
  50. chown git:git /var/lib/gitea/{data,indexers,log}
  51. chmod 750 /var/lib/gitea/{data,indexers,log}
  52. mkdir /etc/gitea
  53. chown root:git /etc/gitea
  54. chmod 770 /etc/gitea
  55. ```
  56. **NOTE:** `/etc/gitea` is temporary set with write rights for user `git` so that Web installer could write configuration file. After installation is done it is recommended to set rights to read-only using:
  57. ```
  58. chmod 750 /etc/gitea
  59. chmod 644 /etc/gitea/app.ini
  60. ```
  61. ### Copy gitea binary to global location
  62. ```
  63. cp gitea /usr/local/bin/gitea
  64. ```
  65. ### Create service file to start gitea automatically
  66. See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
  67. ## Troubleshooting
  68. ### Old glibc versions
  69. Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the
  70. Gitea binary, usually producing an error such as ```./gitea: /lib/x86_64-linux-gnu/libc.so.6:
  71. version `GLIBC\_2.14' not found (required by ./gitea)```. This is due to the integrated
  72. SQLite support in the binaries provided by dl.gitea.io. In this situation, it is usually
  73. possible to [install from source]({{< relref "from-source.en-us.md" >}}) without sqlite
  74. support.
  75. ### Running gitea on another port
  76. For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000:
  77. bind: address already in use` gitea needs to be started on another free port. This
  78. is possible using `./gitea web -p $PORT`. It's possible another instance of gitea
  79. is already running.