
Gitea is an open-source Git service written in the Go language. It is a version control platform similar to GitHub.
It is robust and scalable and offers many features, including issues and time tracking, repository branching, file locking, tagging, merging, and many others.
Since Gitea was created using the Go language, it supports a lot of operating systems, including Linux, macOS, and Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
Table of Contents
Prerequisites
- A Debian 11 VPS
- SSH root access or regular system user with sudo privileges
Step 1. Log in to your server
Using your favorite SSH client, log in to your Debian 11 server.
Replace IP_Address and Port_number with your server’s actual IP address and SSH port number. You can also use another system user with sudo privileges instead of using ‘root’ to log in to your VPS.
This article will use ‘root’ to execute the shell commands. If you want to use your regular user with sudo privileges to run the commands, make sure to append ‘sudo’ in front of the commands.
This tutorial is written for the Debian 11 server. To check your operating system, run this command:
You will get an output like this:
Step 2. Update the System and Create a User
Before starting, you have to ensure that your Debian 11 packages installed on the server are up to date. You can do this by running the following commands:
Now, let’s create a system user
Step 3. Install MariaDB and Create a Database
Gitea requires a database server to store its data. Gitea supports PostgreSQL, MySQL/MariaDB, SQLite, and MSSQL. In this step, we are going to install MariaDB from the default Debian repository.
Once installed, the MariaDB server should be up and running. Execute the command below to create a database and user name and give the privilege to the user.
Replace m0d1fyth15 above with a stronger password.
Step 4. Download and Install Gitea
Now, it is time to download the Gitea binary. We will download it using wget and store it in /usr/local/bin.
Check out more recent versions of Gitea.
We would also need to run these commands.
Then, create a file.
Paste the following into the file.
Save the file, then exit, and give the correct permission.
Step 5. Create Systemd File
We do not need to type the content of the systemd file; simply download it from github.
Time to run the service.
Gitea service should be up and running now. To verify this, we can check with this command.
It will return an output like this.
At this point, you should be able to access it at http://YOUR_SERVER_IP_ADDRESS:3000
To access Gitea using your domain or subdomain name, we need to install a webserver and configure it as a reverse proxy. In this step, we are going to install Nginx as the webserver.
Copy and paste the content below.
Save the file, exit, then restart nginx.
Step 7. Configure Gitea
Now, it is time to install the Gitea service through the web browser. Navigate to your http://gitea.yourdomain.com, and you will see this.
In this step, you need to provide the database credentials, and you can leave the already filled fields. Then, click on Install Gitea.
You will be brought to this step, you can click on ‘Need an account? Register now link to register your first user.
Fill in all required fields, make sure to use a strong password, then click on Register Account
The first account created has administrator privileges, so we can use this user to manage our Gitea website.
That’s it. You have successfully installed Gitea on Debian 11.
Congratulations! You successfully installed and configured Gitea on Debian 11. If you find installing and finishing this setup difficult, you can always contact our admins, who will do the rest for you. We are available 24/7. Always trust our epic support.
PS. If you liked this post on how to install Gitea on Debian 11, please share it with your friends on social networks or simply leave a reply below. Thanks.