🐙 Setup Gitea — Self-Hosted Git Service

Deploy Gitea on Ubuntu with Docker — a lightweight, blazing-fast self-hosted Git platform with repositories, issues, pull requests, wiki, and CI/CD hooks. Your own GitHub, fully under your control.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — Gitea with PostgreSQL backend in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/dev/gitea/gitea-ubuntu.sh
chmod +x gitea-ubuntu.sh
sudo bash gitea-ubuntu.sh

Tutorial Steps

1 Download & Run the Script

The script installs Docker, starts Gitea with a PostgreSQL database, and configures SSH access on port 2222.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/dev/gitea/gitea-ubuntu.sh
chmod +x gitea-ubuntu.sh
sudo bash gitea-ubuntu.sh

2 Complete the Setup Wizard

Open your browser and navigate to Gitea. You'll see the initial setup wizard — confirm your database settings and create the admin account:

http://<your-server-ip>:3100

3 Create Your First Repository

After login, click the "+" icon and create a new repository. You can initialize it with a README, choose a license, and set visibility (public or private). Clone it using the HTTP or SSH URL shown on the repo page.

4 Configure SSH Access

Add your SSH public key under Settings → SSH Keys. Then clone repositories via SSH on port 2222:

git clone ssh://git@<your-server-ip>:2222/username/repo.git

Ports Used

PortPurpose
3100Gitea Web UI & HTTP Git
2222Gitea SSH Git Access