sudo apt-get install git
Get package from gogs (https://gogs.io/docs/installation/install_from_packages)[https://gogs.io/docs/installation/install_from_packages]
and decompress-it
Be carefull with roles (don't use root account and prefer an user account or specifically an new user like 'git')
move into gogs folder and start
./gogs web
Default start on port 3000 use -port ....
for specify another port
You can't install gogs behind reverse proxy, because installation screen start from root
Activate the proxy module for apache
a2enmod proxy
and add in virtualhost (here subdirectory used is /gogs )
ProxyPass /gogs http://127.0.0.1:3000 retry=0 KeepAlive=On
ProxyPassReverse /gogs http://127.0.0.1:3000
don't miss to reload apache
The first created user is an admin user.
Edit {GOGS_FOLDER}/custom/app/app.ini
In [SERVICE] section change value of
DISABLE_REGISTRATION
(Disable registration, after which only admin can create accounts for users)
to true
Install Supervisor (http://supervisord.org/)[http://supervisord.org/]
sudo apt-get install supervisor
Create a directory for the log files
sudo mkdir -p /var/log/gogs
Add a Supervisor configuration file for gogs
sudo nano /etc/supervisor/conf.d/gogs.conf
paste this( update if necessary here user is named 'git' )
[program:gogs]
directory=/home/git/gogs/
command=/home/git/gogs/gogs web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/var/log/gogs/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/gogs/stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment = HOME="/home/git", USER="git"
user = git
Restart Supervisor
sudo service supervisor restart