How To Create Your Own GitHub - Install 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 an Ubuntu 18.04 server (maybe at DigitalOcean or Hetzner).

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
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 Caddy, which also offers easy support for encrypted connections using HTTPS.

20 years old student who writes about everything he cares about.