Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 22.6.1, which is no longer the latest release. See the latest release.

Install on Linux

Follow these steps to run Gitea Enterprise as a native service on a Linux host.

  • 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. 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 update
      sudo 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
  2. Create the git system user and directories:

    • Debian/Ubuntu

      Terminal window
      sudo adduser \
      --system \
      --shell /bin/bash \
      --gecos "Git Version Control" \
      --group \
      --disabled-password \
      git
      sudo mkdir -p /var/lib/gitea/{custom,data,log}
      sudo chown -R git:git /var/lib/gitea
      sudo chmod -R 750 /var/lib/gitea
      sudo mkdir -p /etc/gitea
      sudo chown root:git /etc/gitea
      sudo chmod 770 /etc/gitea
    • RHEL/CentOS/Rocky

      Terminal window
      sudo groupadd --system git
      sudo useradd \
      --system \
      --shell /bin/bash \
      --comment "Git Version Control" \
      --gid git \
      git
      sudo mkdir -p /var/lib/gitea/{custom,data,log}
      sudo chown -R git:git /var/lib/gitea
      sudo chmod -R 750 /var/lib/gitea
      sudo mkdir -p /etc/gitea
      sudo chown root:git /etc/gitea
      sudo chmod 770 /etc/gitea

      If the git group already exists, you can ignore the warning from groupadd.

    The git user keeps its default home directory; /var/lib/gitea simply hosts the application data. This layout matches the recommended Gitea Enterprise directory structure so existing automation remains compatible.

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.

  1. Install the client packages:

    Terminal window
    sudo apt install -y mysql-client # Debian/Ubuntu
    sudo dnf install -y mysql # RHEL/CentOS/Rocky
  2. 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
  3. Point Gitea to MySQL in /etc/gitea/app.ini:

    [database]
    DB_TYPE = mysql
    HOST = db.internal:3306
    NAME = gitea
    USER = gitea
    PASSWD = change-me-now
    SSL_MODE = disable
  1. Install the client packages:

    Terminal window
    sudo apt install -y postgresql-client # Debian/Ubuntu
    sudo dnf install -y postgresql # RHEL/CentOS/Rocky
  2. 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
  3. Configure /etc/gitea/app.ini for PostgreSQL:

    [database]
    DB_TYPE = postgres
    HOST = db.internal:5432
    NAME = gitea
    USER = gitea
    PASSWD = change-me-now
    SSL_MODE = disable

Restart Gitea after updating the connection details.

  1. Pick the Enterprise release you plan to run (for example 24.6.0).

  2. Download and install the binary:

    Terminal window
    VERSION=24.6.0
    curl -L -o gitea \
    "https://gitea.com/commitgo/gitea-ee/releases/download/v${VERSION}/gitea-ee-${VERSION}-linux-amd64"
    sudo mv gitea /usr/local/bin/gitea
    sudo chown root:root /usr/local/bin/gitea
    sudo chmod 755 /usr/local/bin/gitea

    Replace VERSION with the Enterprise release you selected. Use the *-linux-arm64 artifact on ARM servers.

  3. (Optional) Copy an existing app.ini into /etc/gitea/app.ini if you want to skip the setup wizard.

Create /etc/systemd/system/gitea.service based on the reference unit:

[Unit]
Description=Gitea (Enterprise)
After=network.target
[Service]
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
[Install]
WantedBy=multi-user.target

Reload the service manager and start Gitea:

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable --now gitea

Browse to http(s)://<host>:3000/ to finish the initial setup wizard, then follow License Activation to enable Enterprise features.

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.

  • 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.