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.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/dev/gitea/gitea-ubuntu.sh
chmod +x gitea-ubuntu.sh
sudo bash gitea-ubuntu.sh
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
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
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.
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
| Port | Purpose |
|---|---|
| 3100 | Gitea Web UI & HTTP Git |
| 2222 | Gitea SSH Git Access |