This is a creation in Article, where the information may have evolved or changed.
sudo apt-get update
sudo apt-get upgrade
sudo adduser gogs//create user password *******
Su gogs//switch to gogs user
CD ~//Enter user gogs root directory
sudo apt-get install git//installing Git
git--version//check if Git is installed successfully
sudo apt-get install mysql-server//install MySQL database account: root password: ********
MySQL--version//check MySQL version to determine if the installation was successful
Create Data Gogs
Mysql-u root-p
mysql> SET GLOBAL storage_engine = ' InnoDB ';
mysql> CREATE DATABASE gogs CHARACTER SET UTF8 COLLATE utf8_bin;
Mysql> GRANT all privileges on gogs.* to ' root ' @ ' localhost ' identified by ' itadmin ';
mysql> FLUSH privileges;
Mysql> QUIT;
sudo mkdir goapp//go Application installation directory
Installing the Golang Environment
sudo wget http://www.golangtc.com/static/go/go1.4.1.linux-amd64.tar.gz// download 64-bit binaries
Extracting binary files
TAR-XZVF go1.4.1.linux-amd64.tar.gz-c/var/opt/
You can then find a Go folder in the/var/opt/directory, which contains the Golang environment file
Configuring the Golang Environment
echo Export Goroot=/var/opt/go >>. BASHRC
echo Export gobin= $GOROOT/bin >>. BASHRC
echo Export goarch=amd64 >>. BASHRC
echo Export Goos=linux >>. BASHRC
echo Export Gopath=/home/gogs/goapp >>. BASHRC
echo Export path=.: $PATH: $GOBIN >>. BASHRC
Make the configuration environment immediately effective
SOURCE . BASHRC
Use the ENV command to check if the Golang is installed successfully
Go env
sudo mkdir repositories//Create a warehouse directory
CD Goapp
sudo wget http://gogs.dn.qbox.me/gogs_v0.5.11_linux_amd64.zip//Download Gogs
sudo apt-get install ZIP//installation Zip tool for extracting *.zip files
sudo unzip gogs_v0.5.11_linux_amd64.zip//unzip Gogs file
LS//view files and folders in the/home/gogs/goapp directory
CD Gogs//Enter unzip the created file Gogs
mkdir Custom
mkdir custom/conf//Create a custom profile directory
CD Custom/conf/app.ini//Create custom configuration file
sudo chmod-r 777 Custom//Modify Custom folder permissions
mkdir Log//Create logs Directory
sudo chmod-r 777 log//Modify log folder permissions
Start Gogs
Cd/home/gogs/goapp/gogs
./gogs Web
then visit http://localhost:3000 /install to complete the first run configuration work