Skip to content

Instantly share code, notes, and snippets.

@swyngaard
Last active November 6, 2018 10:28
Show Gist options
  • Save swyngaard/6364f3ede74a72b34d96960f9caae61c to your computer and use it in GitHub Desktop.
Save swyngaard/6364f3ede74a72b34d96960f9caae61c to your computer and use it in GitHub Desktop.
Install Gogs in Debian 9 strech

Install Gogs in Debian 9 Stretch

Install and configure PostgreSQL

sudo aptitude install postgresql postgresql-client
sudo adduser gogsuser
sudo su - postgres
createuser -P gogsuser
createdb -O gogsuser gogs
logout

Install Gogs dependencies

sudo aptitude install wget apt-transport-https apt-utils

Install missing libreadline6 package from Debian 8 Jessie

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

Add Gogs apt repository and install

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

Configure HTTP port

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

Perform first run wizard

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.

TODO

  • Setup proxy to port 8080
  • Enable SSL certification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment