Skip to main content

Choose Your Installation Method

Gitea offers multiple installation methods to suit your needs. Choose the one that works best for your environment.

Docker

Recommended - Fastest way to get started with full isolation

Binary

Single executable file - no dependencies required

Package Manager

Install via your system’s package manager

From Source

Build from source for development or customization

Docker Installation

Docker is the recommended installation method for most users. It provides isolation, easy updates, and consistent behavior across platforms.

Using Docker

The simplest way to run Gitea is with Docker:
1

Create directories for persistent data

2

Run Gitea container

  • Port 3000: Web interface (HTTP)
  • Port 222: SSH access (mapped to container’s port 22)
  • Volume /data: Persistent storage for repositories and database
3

Access Gitea

Open your browser and navigate to http://localhost:3000You’ll see the initial configuration page where you can set up your instance.

Using Docker Compose

For production deployments, use Docker Compose with a PostgreSQL database:
Make sure to change the default passwords in production!

Docker Rootless

For enhanced security, run Gitea as a non-root user:

Binary Installation

Install Gitea as a standalone binary - perfect for environments without Docker.
1

Download the binary

Download the latest release for your platform from dl.gitea.com:
2

Verify the binary (optional but recommended)

3

Run Gitea

Gitea will start on port 3000. Open http://localhost:3000 to complete the setup.

Setting up as a Service

For production use, run Gitea as a system service:
1

Create a git user

2

Create required directories

3

Copy binary to system location

4

Create systemd service file

Create /etc/systemd/system/gitea.service with the following content:
5

Enable and start the service

Package Manager Installation

Building from Source

For developers or custom builds with specific features:
1

Prerequisites

  • Go 1.26 or higher - Check with go version
  • Node.js LTS (for frontend) - Check with node --version
  • pnpm - Install with npm install -g pnpm
  • Git - Check with git --version
  • Build tools - gcc/build-essential
2

Clone the repository

3

Build Gitea

Building takes a few minutes. The bindata tag embeds static assets into the binary.
4

Run Gitea

The binary will be created in the project root directory.
For more detailed build instructions, see the CONTRIBUTING.md file in the repository.

Database Setup

Gitea supports multiple database backends:
No setup required! Gitea uses SQLite by default.Perfect for:
  • Small installations (< 100 users)
  • Personal use
  • Testing and development
SQLite is embedded and requires no separate database server.

Initial Configuration

After starting Gitea for the first time:
1

Access the installer

Navigate to http://localhost:3000 in your browser
2

Configure database

Choose your database type and enter connection details
3

Configure server settings

  • Server Domain: Your domain or IP address
  • SSH Port: 22 (or custom port)
  • HTTP Port: 3000 (or custom port)
  • Base URL: Full URL to access Gitea
4

Create admin account

Set up the administrator account for your instance
5

Complete installation

Click “Install Gitea” to finalize the setup
After installation, the configuration is saved to custom/conf/app.ini. You can manually edit this file for advanced configuration.

Firewall Configuration

If you’re using a firewall, open the necessary ports:

Upgrading Gitea

Always backup your data before upgrading! Backup at minimum:
  • Database (if using external DB)
  • custom/conf/app.ini configuration file
  • Repository data directory

Troubleshooting

Check the logs:
  • Docker: docker logs gitea
  • Systemd: sudo journalctl -u gitea -n 50
  • Binary: Check log/gitea.log in your work directory
Common issues:
  • Port already in use
  • Permission issues with data directory
  • Database connection problems
  • Check if Gitea is running: sudo systemctl status gitea or docker ps
  • Verify firewall settings
  • Check that you’re using the correct IP/domain and port
  • Look for errors in logs
  • Verify database is running
  • Check connection credentials in app.ini
  • Ensure database user has proper permissions
  • For PostgreSQL, check pg_hba.conf for connection rules
  • Ensure SSH port is open in firewall
  • Check SSH server is running
  • Verify SSH keys are properly configured
  • Check SSH_PORT in app.ini

Next Steps

Gitea is now installed! Continue with:

Quick Start Guide

Follow our 5-minute quick start to create your first repository

Configuration

Learn about advanced configuration options