gitea install guide

Why use gitea?

What are the differences to github / gitlab? ->

Gitea is a "github clone" that you can host yourself. With this you can (for example) host your own github locally without anyone having access to it. With github you have to pay to host private repositories.
Gitea can also run on a very small raspberry pi zero w without any performance issues. (The zero w has a single core ARM6 Processor)
It is written in go. The website is


Requirements: Have git installed (example: sudo apt-get install git)

Get the latest version of gitea (binary) from gitea ( and make it executeable.
Example with version 1.13.0 on x64 linux (newest version as of 2020.12.26):

wget -O gitea
chmod +x gitea

Add a user for gitea:
adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \

Create directory structure for gitea:
mkdir -p /var/lib/gitea/{custom,data,log}
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea

Now "Install" gitea:
cp gitea /usr/local/bin/gitea

Create service for gitea:
Download and move it to /etc/systemd/system/gitea.service
sudo cp gitea.service /etc/systemd/system/gitea.service

Now start gitea:
sudo systemctl enable gitea --now

The default port for gitea is 3000.

If you don't know what database you want:
Use SQLite3 if you don't have a lot of people working at once. SQLite3 is more minimalistic, but can't handle concurrent writing very well.
With MySQL, you need to have the mysql-server installed and set up with a new user and database.
With SQLite3, you don't have to install or setup anything, because the database is saved in a file locally.

Reverse-proxy via nginx

If you want to reach it via instead of then you can use a reverse proxy. This example requires you to have nginx installed.
Simply add the following to your server block:
location /git/ {
  proxy_pass http://localhost:3000/;
If you want to setup gitea via this reverse-proxy then you also have to do the following:
(You do not have to do this if you visit it via port 3000 to configure it!)
Change the ROOT_URL line in your gitea config (located at /etc/gitea/app.ini with Debian 10):
DOMAIN = localhost
ROOT_URL = http://localhost:3000/git/
If this line doesn't exist then create the code block from above and save the file.

Then check the config via sudo nginx -t.
If there are no problems you can reload the config via sudo nginx -s reload.