How to Install Gitea on Ubuntu 20.04

Install Gitea on Ubuntu 20.04

In this article, we will have explained the necessary steps to install and configure Gitea on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Gitea is a simple, lightweight, and self-hosted Git platform written in Go. It is a fork of Gogs and very similar to GitLab. Compared to GitLab, Gitea is extra easy, lightweight, and straightforward to configure.


  • Operating System with Ubuntu 2o.04
  • Server IPv4 Address with Superuser Privileges (Root Access)
  • Gnome Terminal for Linux Desktop
  • PuTTy SSH client for Windows or macOS
  • Powershell for Windows 10/11
  • Familiar with APT Commands

Install Gitea on Ubuntu 20.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Required Dependencies.

Run the following command to install all dependencies:

sudo apt install sqlite3 git

Step 3. Create Git users.

Create a new system user which will run the Gitea application using the following command below:

sudo adduser \
   --system \
   --shell /bin/bash \
   --gecos 'Git Version Control' \
   --group \
   --disabled-password \
   --home /home/git \

Step 4. Install the Gitea on the Ubuntu system.

Now download the latest Gitea installer:

sudo mv /tmp/gitea /usr/local/bin

Give execute permission to the Gitea:

sudo chmod +x /usr/local/bin/gitea

Next, run the commands below to create the directories and set the required permissions and ownership:

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

Step 5. Create a Systemd Gitea.

Now download the sample systemd unit file to the /etc/systemd/system directory:

sudo wget -P /etc/systemd/system/

Save and close the file then reload the systemd daemon with the following command:

sudo systemctl daemon-reload
sudo systemctl enable --now gitea

Step 6. Configure Firewall.

If you have a UFW firewall running on your server, you’ll need to open the Gitea port. To allow traffic on port 3000, enter the following command:

sudo ufw allow 3000/tcp

Step 7. Access Gitea Web UI.

Now, open your web browser and access the Gitea using the URL You will be redirected to the Gitea setup page.

That’s all you need to do to install Install Gitea on Ubuntu 20.04 LTS Focal Fossa. I hope you find this quick tip helpful. For further reading on Install Gitea, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.