Skip to main content

Gogs Getting Started

Gogs 是一款极易搭建的自助 Git 仓库系统,相对于 GitLab 而言 Gogs 更加轻量级。

If you have installed Websoft9 Gogs, the following steps is for your quick start


  1. Get the Internet IP of your Server on Cloud
  2. Check your Inbound of Security Group Rule of Cloud Console to ensure the TCP:80 is allowed
  3. Complete Five steps for Domain if you want to use Domain for Gogs.
  4. Get default username and password of Gogs

Gogs Initialization

Steps for you

  1. 使用本地电脑浏览器访问网址:http://域名 或 http://服务器公网IP, 进入初始化页面

  2. 填写数据库连接信息(查看预装的数据库账号密码

    • 数据库类型: MySQL

    • 数据库主机名填写:mysql:3306

  3. 设置 Gogs 的应用基本参数

    • 域名:公网IP 或 真实域名
    • SSH 端口: 10022, 可从 Gogs 根目录 .env 文件中查询
    • HTTP 端口: 80 或 3000,可从 Gogs 根目录 .env 文件中查询
    • 应用 URL:http://公网IP 或 http://域名:http端口

  4. 设置管理账号

  5. 安装成功后,直接跳转到后台界面

Having trouble?

Below is for you to solve problem, and you can contact Websoft9 Support or refer to Troubleshoot + FAQ to get more.



Gogs QuickStart

Gogs Setup

Reference sheet

The below items and General parameter sheet is maybe useful for you manage Gogs

通过运行 docker ps,查看 Gogs 运行时所有的服务组件:

CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                    PORTS                                                                                NAMES
3cc976ef4fd5 mysql:5.7 "docker-entrypoint.s…" 19 minutes ago Up 19 minutes 3306/tcp, 33060/tcp gogs-db
d1bf1977d72b gogs/gogs:latest "/app/gogs/docker/st…" 19 minutes ago Up 19 minutes (healthy)>3000/tcp, :::3000->3000/tcp,>22/tcp, :::10022->22/tcp gogs


Gogs installation directory: /data/apps/gogs


3000Gogs 原始端口,已通过 Nginx 转发到 80 端口可选
10022Gogs SSH 端口可选


docker inspect gogs | grep com.docker.compose.version


sudo docker start | stop | restart | stats gogs


$ ./gogs -h
Gogs - A painless self-hosted Git service

gogs [global options] command [command options] [arguments...]


web Start web server
serv This command should only be called by SSH shell
hook Delegate commands to corresponding Git hooks
cert Generate self-signed certificate
admin Perform admin operations on command line
import Import portable data as local Gogs data
backup Backup files and database
restore Restore files and database from backup
help, h Shows a list of commands or help for one command

--help, -h show help
--version, -v print the version

### API

Refer to :[Webhook](