Installing Gitea on Ubuntu 25.04
Gitea is an open-source forge software package for hosting software development version control using Git, as well as other collaborative features like bug tracking, wikis, and code review.
Prerequisites
- Full SSH root access or a user with Sudo privileges is required.
- Gitea supports the following databases:
- SQLite
- PostgreSQL
- MySQL
- MariaDB
In this guide, we’ll use SQLite as the database.
Install SQLite
apt install sqlite3
To check the version:
sqlite3 --version
Output:
root@vps:~# sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69aalt1 (64-bit)
Install Git
Update and upgrade the system:
apt update
apt upgrade
Install Git:
apt install git
Check Git version:
git --version
Output:
root@vps:~# git --version
git version 2.48.1
Create Git user:
adduser --system --shell /bin/bash --gecos 'Git Version Control' --group --disabled-password --home /home/git git
Download the Gitea Binary
wget -O /tmp/gitea https://dl.gitea.com/gitea/1.22/gitea-1.22-linux-amd64
mv /tmp/gitea /usr/local/bin
chmod +x /usr/local/bin/gitea
Set Up Directories and Permissions
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
Create Systemd Service
wget https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/systemd/gitea.service -P /etc/systemd/system/
systemctl daemon-reload
systemctl start gitea
systemctl enable gitea
systemctl status gitea
Configure Gitea
Allow port 3000 in firewall:
ufw allow 3000/tcp
Open your browser and navigate to:
http://your-server-ip:3000
Follow on-screen instructions and configure:
Database Settings:
- Database Type: SQLite3
- Path:
/var/lib/gitea/data/gitea.db
Application Settings:
- Site Title: Your custom title
- Repository Root Path:
/home/git/gitea-repositories
- Git LFS Root Path:
/var/lib/gitea/data/lfs
- Run As Username:
git
- Server Domain: Your domain or IP
- SSH Port: 22
- Gitea HTTP Listen Port: 3000
- Gitea Base URL:
http://yourdomain.com:3000
orhttp://your-ip:3000
- Log Path:
/var/lib/gitea/log
⚠️ Replace
localhost
with your server's IP address or domain name.
Optional Settings:
Create a Administrator user account.
Click on Install button to Install and Configure Gitea.
Once the installation completes, you will be logged in as the Administrator and navigated to dashboard.
Now, you can create your first Gitea Repository with a cup of tea.
Upgrading Gitea
Stop the Gitea service:
systemctl stop gitea
Download the new version:
VERSION=<LATEST_VERSION>
wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64
mv /tmp/gitea /usr/local/bin
chmod +x /usr/local/bin/gitea
Restart the service:
systemctl restart gitea
✅ You have now successfully installed and configured Gitea on Ubuntu 25.04.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS