1
0

installation.mdx 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. title: "Installation"
  3. description: "Get your own Git service up and running in minutes"
  4. icon: "download"
  5. ---
  6. ## Prerequisites
  7. 1. Gogs requires use of one of the following database backends:
  8. - MySQL, >= 5.7
  9. - PostgreSQL, >= 9.6
  10. - SQLite 3
  11. 1. Git, >= 1.8.3, on both server and client side
  12. 1. SSH server
  13. - Only required when enable Git over SSH, e.g., `git clone git@gogs.example.com:...`
  14. - Builtin SSH server is also available
  15. <Note>
  16. **For Windows users:**
  17. - When using builtin SSH server, you still need to have `ssh-keygen` installed and available via the `%PATH%` environment variable.
  18. - Use [OpenSSH](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse) on Windows 10 or newer.
  19. - [Cygwin OpenSSH](http://docs.oracle.com/cd/E24628_01/install.121/e22624/preinstall_req_cygwin_ssh.htm) or [Copssh](https://www.itefix.net/copssh) are available on older versions of Windows.
  20. </Note>
  21. ## Initialize database
  22. If you choose to use MySQL or PostgreSQL as your database backend, you need to first complete the initial database creation.
  23. <Tabs>
  24. <Tab title="PostgreSQL">
  25. Create a database user and database:
  26. ```bash
  27. psql -c "CREATE USER gogs WITH PASSWORD '{YOUR_PASSWORD}';"
  28. psql -c "CREATE DATABASE gogs OWNER gogs ENCODING 'UTF8';"
  29. ```
  30. </Tab>
  31. <Tab title="MySQL">
  32. Use the [bundled script](https://github.com/gogs/gogs/blob/main/scripts/mysql.sql) to create the database with proper encoding:
  33. ```zsh
  34. mysql -u root -p < scripts/mysql.sql
  35. ```
  36. </Tab>
  37. </Tabs>
  38. ## Installation methods
  39. <Tabs>
  40. <Tab title="Pre-built binary">
  41. All release archives containing pre-built binaries are available in [dl.gogs.io](https://dl.gogs.io) and [GitHub releases](https://github.com/gogs/gogs/releases).
  42. <Note>
  43. **For Windows users:**
  44. Release archives containing `mws` come with built-in Windows service support. If you prefer to manage the service using [NSSM](https://nssm.cc), download the standard version instead.
  45. </Note>
  46. Once extracted the archive, run `gogs web` to start the server. Use `gogs web --help` to see all available options.
  47. </Tab>
  48. <Tab title="Docker">
  49. Two types of Docker images are provided:
  50. 1. [docker-next](https://github.com/gogs/gogs/blob/main/docker-next/README.md): The modern, non-root, and cloud-native version, but with no container options.
  51. 1. [docker](https://github.com/gogs/gogs/blob/main/docker/README.md): The traditional, root-privileged version, with extensive container options.
  52. </Tab>
  53. <Tab title="Packages">
  54. <Warning>
  55. All packages listed below are packaged by third-party maintainers. Use at your own risk.
  56. </Warning>
  57. |Source| Description | Note|
  58. |------|------------------------------------------|-----|
  59. |Packager.io ([link](https://packager.io/gh/gogs/gogs))|Every commit of `main`|After installation, place custom configuration in `/etc/default/gogs`.|
  60. |Arch User Repository ([link](https://aur.archlinux.org/packages/gogs/))| Stable releases | Detailed instructions available in the [Arch Linux Wiki entry](https://wiki.archlinux.org/title/Gogs). |
  61. </Tab>
  62. </Tabs>