Skip to content

How to Deploy Gogs with Go Project

Deploy Gogs via Go Project, specify the runtime user as root, and enable port-free access.

Download Gogs

Download URL: https://github.com/gogs/gogs/releases

Please select the corresponding version according to your server architecture.

For Linux X86_64:

wget https://github.com/gogs/gogs/releases/download/v0.14.2/gogs_v0.14.2_linux_amd64.zip

alt text

Unzip the Gogs File

  • Unzip Gogs

alt text

  • After extraction: alt text

  • The gogs directory will look like this: alt text

Modify Permissions

Set the executable permission of the gogs directory to 744 and the owner user to root.

alt text

alt text

Add Gogs to Go Project

Website -> Go Project -> Add Project

alt text

  • Executable File: /www/wwwroot/go/gogs/gogs

  • Project Name: gogs

  • Project Port: 3000, default port used after enabling mapping

  • Release port: When selected, the system firewall will open the project port automatically

  • Execution Command: /www/wwwroot/go/gogs/gogs web, Gogs requires the web parameter to start

  • Run User: root

After successful addition, it will display as follows: alt text

Test Access to Gogs

Visit http://Your-IP:3000 in your browser.

alt text

  • If you did not select Release port, please open port 3000 manually in the Security interface.
  • If your server provider has a security group, please open port 3000.

Production-Grade Deployment

Reverse proxy the Gogs port via web server for port-free access through domain.

  1. Add a domain name in the Gogs project's Domain Manageralt textalt text

  2. Enable External network mapping in the Mapping interface alt text

  3. Deploy an SSL certificate in the SSL interface

  4. Test access: https://domain.comalt text

For more configuration about Gogs, please refer to the official documentation: https://gogs.io/