CentOS / RHEL 8 64 bits

Installation instructions

sudo wget -O /etc/yum.repos.d/gogs.repo \
  https://dl.packager.io/srv/gogs/gogs/main/installer/el/8.repo
sudo yum install gogs

Here is how you would install MySQL and setup NginX to get a fully working installation:

Debian/Ubuntu

APP_NAME="gogs"
MYSQL_PASSWORD="change_me"
HOSTNAME="example.com"

# setup mysql server and database
debconf-set-selections <<CONFIG
mysql-server-5.5 mysql-server/root_password password ${MYSQL_PASSWORD}
mysql-server-5.5 mysql-server/root_password_again password ${MYSQL_PASSWORD}
CONFIG
apt-get install -y --force-yes mysql-server
mysql -uroot -p${MYSQL_PASSWORD} -e "create database if not exists ${APP_NAME};"

# setup nginx configuration
apt-get install -y nginx
cat > /etc/nginx/sites-available/default <<EOF
server {
  listen          80;
  server_name     ${HOSTNAME};
  location / {
    proxy_pass      http://localhost:6000;
  }
}
EOF
sudo service nginx restart

Now, access http://${HOSTNAME} and finish the installation process. Easy!

CentOS/RHEL

APP_NAME="gogs"
MYSQL_PASSWORD="change_me"
HOSTNAME="example.com"

# setup mysql
yum install mysql-server -y
service mysql-server start
chkconfig mysql-server

mysqladmin -u root password "${MYSQL_PASSWORD}"
mysqladmin -u root --password="${MYSQL_PASSWORD}" password "${MYSQL_PASSWORD}"
mysql -u root -p${MYSQL_PASSWORD} -e "CREATE DATABASE IF NOT EXISTS ${APP_NAME}; use ${APP_NAME}; set global storage_engine=INNODB;"

# install nginx
rpm -Uhv http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
 yum install -y nginx

cat > /etc/nginx/conf.d/default.conf <<EOF
server {
  listen          80;
  server_name     ${HOSTNAME};
  location / {
    proxy_pass      http://localhost:6000;
  }
}
EOF

service nginx start
chkconfig nginx on

Now, access http://${HOSTNAME} and finish the installation process. Easy!