Gitea is a free and open-source Git repository hosting platform written in the Go language. It allows you to work with version control software with other features including issue tracking, pull requests, user management, notifications, and more. It is very similar to GitHub, Bitbucket, and Gitlab, and can run on Linux, macOS, Windows, and ARM. If you are looking for an open-source, lightweight, and self-hosted code hosting platform, then Gitea is the best choice for you.
In this post, we will show you how to install Gitea on Rocky Linux 10.
Step 1 – Install and Configure MariaDB Database
Gitea uses a MariaDB, MySQL, or PostgreSQL as a database backend, so one of the database software solutions must be installed on your server.
First, install all the required dependencies using the following command:
dnf install git unzip gnupg2 nano wget -y
Once all the dependencies are installed, run the following command to install MariaDB:
dnf install mariadb-server -y
Next, start and enable the MariaDB service using the following command:
systemctl start mariadb systemctl enable mariadb
Next, you will need to create a database and user for Gitea.
First, log in to the MariaDB shell with the following command:
mysql
Once you are logged in, create a database and user with the following command:
CREATE DATABASE gitea CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'; GRANT ALL ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY 'password';
Next, flush the privileges and exit from the MariaDB shell with the following command:
FLUSH PRIVILEGES; EXIT;
Next, edit the MariaDB configuration file:
nano /etc/my.cnf.d/mariadb-server.cnf
Add the following lines below the line [mysqld]:
innodb_file_format = Barracuda innodb_large_prefix = 1 innodb_default_row_format = dynamic
Save and close the file then restart the MariaDB service to apply the changes:
systemctl restart mariadb
Step 2 – Install and Configure Gitea
First, create a dedicated user to run Gitea using the following command:
useradd --system --shell /bin/bash --comment 'Git Version Control' --create-home --home /home/git git
Next, download the latest version of the Gitea binary with the following command:
wget -O gitea https://dl.gitea.io/gitea/1.18.5/gitea-1.18.5-linux-amd64
Next, move the downloaded binary to the system path and set proper permissions:
mv gitea /usr/bin/gitea chmod 755 /usr/bin/gitea
Next, verify the Gitea version using the following command:
gitea --version
You should get the following output:
Gitea version 1.18.5 built with GNU Make 4.1, go1.19.6 : bindata, sqlite, sqlite_unlock_notify
Next, you will need to create a directory structure for Gitea.
You can create it with the following commands:
mkdir -p /var/lib/gitea/{custom,data,indexers,public,log} chown git: /var/lib/gitea/{data,indexers,log} chmod 750 /var/lib/gitea/{data,indexers,log} mkdir /etc/gitea chown root:git /etc/gitea chmod 770 /etc/gitea
Step 3 – Create a Systemd Service File for Gitea
Next, you will need to create a systemd service file to manage the Gitea service:
nano /etc/systemd/system/gitea.service
Add the following lines:
[Unit] Description=Gitea After=syslog.target After=network.target After=mysql.service [Service] RestartSec=2s Type=simple User=git Group=git WorkingDirectory=/var/lib/gitea/ ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini Restart=always Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea [Install] WantedBy=multi-user.target
Save and close the file, then reload the systemd daemon with the following command:
systemctl daemon-reload
Next, start the Gitea service and enable it to start at system reboot:
systemctl start gitea systemctl enable gitea
You can now check the status of Gitea using the following command:
systemctl status gitea
You should see the following output:
ā gitea.service - Gitea Loaded: loaded (/etc/systemd/system/gitea.service; disabled; preset: disabled) Active: active (running) since Sun 2025-10-19 04:43:49 EDT; 6s ago Invocation: 737040845e884c489e74e7a169ff9d35 Main PID: 27262 (gitea) Tasks: 8 (limit: 24809) Memory: 110.4M (peak: 110.6M) CPU: 700ms CGroup: /system.slice/gitea.service āā27262 /usr/bin/gitea web -c /etc/gitea/app.ini
By default, Gitea listens on port 3000. You can verify it using the following command:
ss -antpl | grep 3000
You should get the following output:
LISTEN 0 128 *:3000 *:* users:(("gitea",pid=8998,fd=6))
Step 4 – Access Gitea Web Interface
Now, open your web browser and type the URL http://your-server-ip:3000 to access the Gitea web interface. You will get the following screen:
Provide your Gitea repository name, run as username, listen port, base URL, admin username, and password and click on the Install Gitea button. Once the installation has been completed, you will be redirected to the Gitea dashboard:
Conclusion
In this guide, you learned how to install the Gitea code hosting platform on RockyLinux 10. You can now start implementing Gitea in your development environment to manage and track your code. Give it a try on your dedicated server from Atlantic.Net!