Skip to content

Gogs Configuration Overview

Gogs keeps default configuration in conf/app.ini. You normally do not edit that file directly, because the default configuration has been embedded into the binary since v0.6.0.

Custom configuration

Create custom/conf/app.ini and override only the options you need.

Example repository root:

[repository]
ROOT = /home/jiahuachen/gogs-repositories

Example database password:

[database]
PASSWD = root

This approach protects custom configuration during binary replacement or source updates.

Running Gogs

Development mode:

$ make
$ ./gogs web

Deployment mode:

  • Start normally with ./gogs web.
  • Use scripts from the scripts directory when running as a service.
  • Visit /install to complete first-run configuration.

Key configuration sections

  • server: protocol, domain, root URL, HTTP listen address, SSH options, static file path, and gzip.
  • repository: repository root, script type, forced private repositories, raw file rendering, and migration settings.
  • database: database type, host, name, user, password, and SQLite path.
  • security: install lock, secret key, login cookies, and reverse proxy authentication.
  • service: registration, captcha, mail notification, and cache avatar settings.
  • webhook: webhook type, queue length, delivery timeout, and TLS verification.
  • mailer: SMTP host, sender, username, password, and STARTTLS behavior.
  • log: log root path, output mode, level, and rotation settings.
  • git: diff display limits and Git operation timeouts.

REF

[1]. https://www.cnblogs.com/sanduzxcvbnm/p/11351991.html

[2]. Build-Git-Server-Using-Gogs-with-Docker-and-Employ-Frp-with-Caddy-Reverse-Proxy