How to Install Gitea on Debian 13

Gitea is a self-hosted Git service that’s fast and easy to install. It provides version control, bug tracking, code review, and wikis — making it a great lightweight alternative to GitHub or GitLab.


Prerequisites

  • Full SSH root access.
  • Gitea supports SQLite, PostgreSQL, MySQL, and MariaDB.
  • In this guide, we will use SQLite.

Install SQLite:

apt update
apt install sqlite3 -y

Check SQLite version:

sqlite3 --version

Output:

root@server:~# sqlite3 --version
3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69aalt1 (64-bit)

Install Required Packages

Update the system:

apt update -y
apt upgrade -y

Install Git:

apt install git -y

Output:

root@server:~# apt install git -y
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'apt autoremove' to remove it.

Installing:
  git

Installing dependencies:
  git-man             libnghttp3-9              libsasl2-modules
  libcurl3t64-gnutls  libngtcp2-16              libsasl2-modules-db
  liberror-perl       libngtcp2-crypto-gnutls8  libssh2-1t64
  libldap-common      librtmp1                  patch
  libldap2            libsasl2-2

Suggested packages:
  git-doc    git-cvs                            libsasl2-modules-ldap
  git-email  git-mediawiki                      libsasl2-modules-otp
  git-gui    git-svn                            libsasl2-modules-sql
  gitk       libsasl2-modules-gssapi-mit        ed
  gitweb     | libsasl2-modules-gssapi-heimdal  diffutils-doc

Summary:
  Upgrading: 0, Installing: 15, Removing: 0, Not Upgrading: 0
  Download size: 12.5 MB
  Space needed: 56.4 MB / 18.5 GB available

Check Git version:

git --version

Output:

root@server:~# git --version
git version 2.47.2

Create Gitea User

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

Download Gitea Binary

Install wget:

apt install wget -y

Output:

root@server:~# apt install wget -y
wget is already the newest version (1.25.0-2).
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'apt autoremove' to remove it.

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

Download latest Gitea version (e.g. 1.24.4):

wget -O /usr/local/bin/gitea https://dl.gitea.com/gitea/1.24.4/gitea-1.24.4-linux-amd64
chmod +x /usr/local/bin/gitea

Output:

root@server:~# wget -O /usr/local/bin/gitea https://dl.gitea.com/gitea/1.24.4/gitea-1.24.4-linux-amd64
chmod +x /usr/local/bin/gitea
--2025-08-13 09:16:03--  https://dl.gitea.com/gitea/1.24.4/gitea-1.24.4-linux-amd64
Resolving dl.gitea.com (dl.gitea.com)... 18.239.50.49, 18.239.50.47, 18.239.50.2, ...
Connecting to dl.gitea.com (dl.gitea.com)|18.239.50.49|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 113176632 (108M) [binary/octet-stream]
Saving to: ‘/usr/local/bin/gitea’

/usr/local/bin/gite 100%[===================>] 107.93M  75.0MB/s    in 1.4s

2025-08-13 09:16:04 (75.0 MB/s) - ‘/usr/local/bin/gitea’ saved [113176632/113176632]

Create Gitea Directory Structure

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

Setup Systemd Service

Download Gitea systemd unit:

wget https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service -P /etc/systemd/system/

Output:

root@server:~# wget https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service -P /etc/systemd/system/
--2025-08-07 14:55:29--  https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2435 (2.4K) [text/plain]
Saving to: ‘/etc/systemd/system/gitea.service’

gitea.service       100%[===================>]   2.38K  --.-KB/s    in 0.001s

2025-08-07 14:55:29 (4.53 MB/s) - ‘/etc/systemd/system/gitea.service’ saved [2435/2435]

Reload and enable the service:

systemctl daemon-reload
systemctl enable --now gitea

Check service status:

systemctl status gitea

Output:

root@server:~# systemctl status gitea
● gitea.service - Gitea (Git with a cup of tea)
     Loaded: loaded (/etc/systemd/system/gitea.service; enabled; preset: enable>
     Active: active (running) since Wed 2025-08-13 09:19:59 EDT; 1min 53s ago
 Invocation: 26dc5984e08c47a4b6e035eb46a32d29
   Main PID: 11522 (gitea)
      Tasks: 8 (limit: 7052)
     Memory: 93.8M (peak: 95.8M)
        CPU: 1.332s
     CGroup: /system.slice/gitea.service
             └─11522 /usr/local/bin/gitea web --config /etc/gitea/app.ini

Configure Gitea

Allow port 3000:

apt install ufw -y
ufw allow 3000/tcp

Output:

root@server:~# ufw allow 3000/tcp
Rules updated
Rules updated (v6)

Now open your browser and navigate to:

http://your-server-ip:3000

Database Settings

  • Database Type: SQLite3
  • Path: /var/lib/gitea/data/gitea.db

image

Application Settings

  • Site Title: Your desired site name
  • Repository Root Path: /home/git/gitea-repositories
  • Git LFS Path: /var/lib/gitea/data/lfs
  • Run As User: git
  • SSH Server Domain: Your IP or domain
  • SSH Port: 22 (or your custom SSH port)
  • HTTP Port: 3000
  • Base URL: http://your-ip:3000
  • Log Path: /var/lib/gitea/log

Click Install Gitea to proceed.

image

image

Once submitted, you'll see the Gitea dashboard:

image

Done.


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