GitHub has recently experienced some downtime. Though they were quickly fixed, you can still ask yourself if you shouldn't make your own backup, just to be sure that you don't have to stop all your work because of a few outages at Github.
In this article I want to show how I installed Gitea on my Ubuntu 16.04 server at DigitalOcean (sign up via this link and you'll get $10 free credit). I already use this server for a few websites, but there are still some resources available.
The installation is actually quite simple...
Gitea can be downloaded directly as an executable file for Linux, as described in the Docs. For example, in the folder
/var/wwww/gitea. This should not be done with the root user, but the user should have the appropriate permissions for the folder.
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 chmod +x gitea
Whether this has worked out so far can be checked here:
When entering the IP address of the server with port 3000, an installation page should now appear (settings of the server's firewall may have to be adjusted). In addition to MySQL, Gitea also supports SQLite out of the box, which saves a lot of extra effort and can save resources if MySQL is not needed for any other projects.
This installation request must now be followed until the Gitea interface appears.
However, since it is not very advantageous to run Gitea permanently via terminal, the next step is to set up a system service.
sudo nano /etc/systemd/system/gitea.service
Now insert the content of the example file with nano, customize the user and the file paths and save.
Enable and start gitea at boot:
sudo systemctl enable gitea sudo systemctl start gitea
Now gitea is running as a service on Port 3000, but this is very unfortunate and it is recommended to use a proxy server like Nginx, which also offers support for encrypted connections with HTTPS. But that's content of another article...