sudo aptitude install postgresql postgresql-client
sudo adduser gogsuser
sudo su - postgres
createuser -P gogsuser
createdb -O gogsuser gogs
logout
sudo aptitude install wget apt-transport-https apt-utils
wget http://ftp.us.debian.org/debian/pool/main/r/readline6/libreadline6_6.3-8+b3_amd64.deb
sudo apt install ./libreadline6_6.3-8+b3_amd64.deb
wget -qO- https://dl.packager.io/srv/pkgr/gogs/key | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/gogs.list https://dl.packager.io/srv/pkgr/gogs/pkgr/installer/debian/8.repo
sudo aptitude update
sudo aptitude install gogs
Edit /etc/systemd/system/gogs-web-1.service
and change the line Environment=PORT=6000
to another port. In this case, we change it to port 8080
:
Environment=PORT=8080
Restart the service:
sudo systemctl daemon-reload
sudo systemctl restart gogs-web-1.service
Browse to http://localhost:8080/install
to initiate the configuration wizard. Select PostgreSQL as the database and enter the user, password and database you configured above.
- Setup proxy to port 8080
- Enable SSL certification