How To Create Your Own GitHub - Installing Gitea on Ubuntu 18.04

GitHub sometimes experiences some downtimes. Though they are usually 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 you can install Gitea on a Ubuntu 18.04 server (maybe at DigitalOcean - sign up via this link and you’ll get $10 free credit).

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.4.3/gitea-1.4.3-linux-amd64
chmod +x gitea

Whether this has worked out so far can be checked here:

./gitea web

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…

Changes:
31.07.2018: Ubuntu 18.04 and Gitea 1.4.3