Install on Linux
Follow these steps to run Gitea Enterprise as a native service on a Linux host.
Prerequisites
Section titled “Prerequisites”-
Supported software platform: a 64-bit Linux distribution with
systemd(for example Ubuntu 22.04, Debian 12, RHEL 9, Rocky Linux 9). -
Root access or the ability to run
sudo. -
Recommended hardware sized for your expected user base:
Team size (approx.) Memory CPU cores SSD capacity ~10 users 2-4 GB 2-4 cores 50-100 GB ~100 users 4-8 GB 4-8 cores 200-500 GB ~1000 users 16-32 GB 8-16 cores 2-5 TB -
External MySQL/MariaDB or PostgreSQL database. Gitea Enterprise does not support SQLite.
-
Git command-line tools (installed in the steps below).
-
(Optional) An Enterprise license to unlock Enterprise features. See License Activation when you are ready to apply one.
1. Prepare the host
Section titled “1. Prepare the host”-
Install dependencies (consult the upstream dependency list if you plan to use MySQL/PostgreSQL, image processing, or other optional features):
-
Debian/Ubuntu
Terminal window sudo apt updatesudo apt install -y git ca-certificates -
RHEL/CentOS/Rocky
Terminal window sudo dnf install -y git ca-certificates# Replace dnf with yum if you run an older release
-
-
Create the
gitsystem user and directories:-
Debian/Ubuntu
Terminal window sudo adduser \--system \--shell /bin/bash \--gecos "Git Version Control" \--group \--disabled-password \gitsudo mkdir -p /var/lib/gitea/{custom,data,log}sudo chown -R git:git /var/lib/giteasudo chmod -R 750 /var/lib/giteasudo mkdir -p /etc/giteasudo chown root:git /etc/giteasudo chmod 770 /etc/gitea -
RHEL/CentOS/Rocky
Terminal window sudo groupadd --system gitsudo useradd \--system \--shell /bin/bash \--comment "Git Version Control" \--gid git \gitsudo mkdir -p /var/lib/gitea/{custom,data,log}sudo chown -R git:git /var/lib/giteasudo chmod -R 750 /var/lib/giteasudo mkdir -p /etc/giteasudo chown root:git /etc/giteasudo chmod 770 /etc/giteaIf the
gitgroup already exists, you can ignore the warning fromgroupadd.
The
gituser keeps its default home directory;/var/lib/giteasimply hosts the application data. This layout matches the recommended Gitea Enterprise directory structure so existing automation remains compatible. -
2. Configure the database (optional)
Section titled “2. Configure the database (optional)”External databases improve scalability and availability. Gitea Enterprise supports MySQL/MariaDB and PostgreSQL out of the box. Run these commands before the first start so the application can connect immediately.
MySQL / MariaDB
Section titled “MySQL / MariaDB”-
Install the client packages:
Terminal window sudo apt install -y mysql-client # Debian/Ubuntusudo dnf install -y mysql # RHEL/CentOS/Rocky -
Create the database and user (adjust credentials to your policy):
Terminal window mysql -u root -p <<'SQL'CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'gitea'@'%' IDENTIFIED BY 'change-me-now';GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'%';FLUSH PRIVILEGES;SQL -
Point Gitea to MySQL in
/etc/gitea/app.ini:[database]DB_TYPE = mysqlHOST = db.internal:3306NAME = giteaUSER = giteaPASSWD = change-me-nowSSL_MODE = disable
PostgreSQL
Section titled “PostgreSQL”-
Install the client packages:
Terminal window sudo apt install -y postgresql-client # Debian/Ubuntusudo dnf install -y postgresql # RHEL/CentOS/Rocky -
Create the database and user:
Terminal window sudo -u postgres psql <<'SQL'CREATE DATABASE gitea WITH ENCODING 'UTF8' LOCALE 'C' TEMPLATE template0;CREATE USER gitea WITH PASSWORD 'change-me-now';GRANT ALL PRIVILEGES ON DATABASE gitea TO gitea;SQL -
Configure
/etc/gitea/app.inifor PostgreSQL:[database]DB_TYPE = postgresHOST = db.internal:5432NAME = giteaUSER = giteaPASSWD = change-me-nowSSL_MODE = disable
Restart Gitea after updating the connection details.
3. Install the Gitea Enterprise binary
Section titled “3. Install the Gitea Enterprise binary”-
Pick the Enterprise release you plan to run (for example
24.6.0). -
Download and install the binary:
Terminal window VERSION=24.6.0curl -L -o gitea \"https://gitea.com/commitgo/gitea-ee/releases/download/v${VERSION}/gitea-ee-${VERSION}-linux-amd64"sudo mv gitea /usr/local/bin/giteasudo chown root:root /usr/local/bin/giteasudo chmod 755 /usr/local/bin/giteaReplace
VERSIONwith the Enterprise release you selected. Use the*-linux-arm64artifact on ARM servers. -
(Optional) Copy an existing
app.iniinto/etc/gitea/app.iniif you want to skip the setup wizard.
4. Configure systemd
Section titled “4. Configure systemd”Create /etc/systemd/system/gitea.service based on the reference unit:
[Unit]Description=Gitea (Enterprise)After=network.target
[Service]RestartSec=2sType=simpleUser=gitGroup=gitWorkingDirectory=/var/lib/giteaExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.iniRestart=alwaysEnvironment=USER=git HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
[Install]WantedBy=multi-user.targetReload the service manager and start Gitea:
sudo systemctl daemon-reloadsudo systemctl enable --now giteaBrowse to http(s)://<host>:3000/ to finish the initial setup wizard, then follow License Activation to enable Enterprise features.
5. Post-install configuration
Section titled “5. Post-install configuration”After Gitea Enterprise is running, review the configuration options you may want to enable (SMTP, object storage, authentication, and so on). The upstream Configuration Cheat Sheet lists every app.ini setting with short explanations. Update /etc/gitea/app.ini, then restart the service when you apply changes.
6. Upgrades and maintenance
Section titled “6. Upgrades and maintenance”- Stop the service, download the newer Enterprise binary, replace
/usr/local/bin/gitea, and start the service. - Follow the upstream maintenance guidance for backups, staging tests, and database migrations.
- For multi-node deployments, provision externalized Redis, object storage, and load balancing to match your redundancy targets before adding more application nodes.
Gitea Enterprise keeps configuration and data layouts stable across releases, so existing automation continues to work.