How to Install Gitea on Elementary OS

Gitea is a lightweight self-hosted Git service that is a great alternative to some other popular Git services like GitHub and GitLab. In this tutorial, we will show you how to install Gitea on the latest version of Elementary OS.

Prerequisites

Before we get started with the installation process, you need to make sure that you have the following prerequisites installed on your system:

Step 1: Install Dependencies

Gitea requires some dependencies to be installed on your system. You can install them by running the following command in your terminal:

sudo apt install sqlite3 git mercurial subversion

Step 2: Download Gitea

You can download the latest version of Gitea from its official website https://gitea.io/en-us/downloads/. You can either download the source code or pre-built binaries for your system. We recommend downloading the binary release for your system.

In this tutorial, we will download the 64-bit Linux binary release. You can download it by running the following command in your terminal:

wget -O gitea https://dl.gitea.io/gitea/1.15.4/gitea-1.15.4-linux-amd64

Note: Make sure to replace the version number with the latest version available on the official website.

Step 3: Install Gitea

After downloading the Gitea binary, you need to move it to the /usr/local/bin directory and give it execute permission. You can do that by running the following commands in your terminal:

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

Step 4: Configure Gitea

Now, you need to create a user for the Gitea service. You can create a new user by running the following command in your terminal:

sudo adduser --system --shell /bin/bash --comment 'Git Version Control' --user-group --create-home --home /home/git git

After creating a user, you need to create a directory for Gitea data storage. You can create a new directory by running the following command in your terminal:

sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public}/
sudo chown -R git:git /var/lib/gitea/
sudo chmod -R 750 /var/lib/gitea/

Step 5: Start Gitea Service

You can start the Gitea service by running the following commands in your terminal:

sudo systemctl enable gitea
sudo systemctl start gitea

Step 6: Access Gitea Web Interface

After starting the Gitea service, you can access the Gitea web interface using your web browser. Open your web browser and enter the following URL:

http://localhost:3000/

You should now see the Gitea web interface.

Conclusion

That's it! You have successfully installed Gitea on the latest version of Elementary OS. You can now create your own Git repositories and manage them with Gitea.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!