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: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:
- Linux (amd64)
- Linux (arm64)
- macOS
- Windows
2
Verify the binary (optional but recommended)
3
Run Gitea
http://localhost:3000 to complete the setup.Setting up as a Service
For production use, run Gitea as a system service:- systemd (Linux)
- Windows 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
- Homebrew (macOS/Linux)
- Snap (Linux)
- Arch Linux (AUR)
- Debian/Ubuntu
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
- Standard Build
- With SQLite Support
- Backend Only
Building takes a few minutes. The
bindata tag embeds static assets into the binary.4
Run Gitea
For more detailed build instructions, see the CONTRIBUTING.md file in the repository.
Database Setup
Gitea supports multiple database backends:- SQLite (Default)
- PostgreSQL (Recommended)
- MySQL/MariaDB
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 browser2
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
- Docker
- Binary
Troubleshooting
Gitea won't start
Gitea won't start
Check the logs:
- Docker:
docker logs gitea - Systemd:
sudo journalctl -u gitea -n 50 - Binary: Check
log/gitea.login your work directory
- Port already in use
- Permission issues with data directory
- Database connection problems
Can't access via browser
Can't access via browser
- Check if Gitea is running:
sudo systemctl status giteaordocker ps - Verify firewall settings
- Check that you’re using the correct IP/domain and port
- Look for errors in logs
Database connection failed
Database connection failed
- Verify database is running
- Check connection credentials in
app.ini - Ensure database user has proper permissions
- For PostgreSQL, check
pg_hba.conffor connection rules
SSH not working
SSH not working
- Ensure SSH port is open in firewall
- Check SSH server is running
- Verify SSH keys are properly configured
- Check
SSH_PORTinapp.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