Skip to main content

Prerequisites

  1. Gogs requires use of one of the following database backends:
    • MySQL, >= 5.7
    • PostgreSQL, >= 9.6
    • SQLite 3
  2. Git, >= 1.8.3, on both server and client side
  3. SSH server
    • Only required when enable Git over SSH, e.g., git clone [email protected]:...
    • Builtin SSH server is also available
For Windows users:
  • When using builtin SSH server, you still need to have ssh-keygen installed and available via the %PATH% environment variable.
  • Use OpenSSH on Windows 10 or newer.
  • Cygwin OpenSSH or Copssh are available on older versions of Windows.

Initialize database

If you choose to use MySQL or PostgreSQL as your database backend, you need to first complete the initial database creation.
Create a database user and database:
psql -c "CREATE USER gogs WITH PASSWORD '{YOUR_PASSWORD}';"
psql -c "CREATE DATABASE gogs OWNER gogs ENCODING 'UTF8';"

Installation methods

All release archives containing pre-built binaries are available in dl.gogs.io and GitHub releases.
For Windows users:Release archives containing mws come with built-in Windows service support. If you prefer to manage the service using NSSM, download the standard version instead.
Once extracted the archive, run ./gogs web to start the server. Use ./gogs web --help to see all available options.