Skip to main content
  1. Posts/

Host your own Git Service with Gitea

·2 mins· loading ·
Self-hosting Application
Timo
Author
Timo
Business Applications Architect, Network Engineer, Self-hosting Hobbyist.
Table of Contents

Gitea is an open-source, self-hosted Git management platform that is designed to be lightweight and easy to use. It offers all the features you would expect from a Git hosting platform, including support for Git LFS, webhooks, and issue tracking. Gitea is highly customizable and can be easily installed on a wide range of operating systems, making it a great option for those looking to host their own Git repositories.

Installation
#

Use the provided docker-compose.yml to install Gitea.

version: "3"

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: unless-stopped
    volumes:
      - /path/to/data:/data:Z
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
    ports:
      - "<PORT>:3000"
Change USER_UID, USER_GID, /path/to/data and <PORT> according to your setup.

Start the container with:

docker-compose up -d

Initial Configuration
#

After successfully installing Gitea you can access the Web GUI via http://<IP_ADDRESS>:<PORT> which starts the initial configuration.

Start off by setting the Title and Base URL of your site.

Initial configuration of Gitea.
Initial configuration.

Set your SMTP Settings(if needed), check Disable Self-Registration and Require Sign-In to View Pages in the optional settings.

Optional Settings of Gitea.
Optional Settings.

Create an Admin Account in the last step and confirm by clicking the
Install Gitea Button.

Create your Gitea Admin Account.
Create your Gitea Admin Account.

Your first Repository
#

Now that you have Gitea up and running you can create your first repository.

Create your first Repository in Gitea.
Create your first Repository.

As a first example of documented code create a new file Gitea/docker-compose.yml, paste your configuration and click Commit Changes.

Create your first File in Gitea.
Create your first File for Source Control.

Final Thoughts
#

In conclusion, Gitea is a powerful and versatile self-hosted Git platform that offers a range of features and customization options. It is a great choice for individuals and organizations who want to take Source Control into their own hands without having to rely on a third-party provider. Whether you are a solo developer or part of a large team, Gitea can help you manage your Git projects more efficiently and effectively.

If you enjoy Gitea please leave a ⭐ at the Gitea GitHub Repo.