Post

Migrating to a self-hosted private repository

Migrating repositories to a self-hosted alternative.

I’ve been interested in having an offline alternative to github for some of my larger projects. Hosting smaller projects on Github is fine, however for projects that are several gigabytes in size, space is limited. Having docker installed on my self hosted server provides a lot of possibilties for deploying private repos. For my needs, Gitea provides a fast and easy way to deploy a self hosted Git-service over my local network.

Setting up an instance was a breeze with Docker-Compose and following the template on the gitea docs, making sure to change volume variables as well as ports to prevent conflicts.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: "2"

services:
  server:
    image: gitea/gitea:1.21.7-rootless
    restart: always
    volumes:
      - ./data:/var/lib/gitea
      - ./config:/etc/gitea
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "2222:2222"

One deployed, Gitea prompts to create an admin profile. One of the best features of Gitea automatic pulling from respositories from other sites (such as github) and maintains them automatically

This post is licensed under CC BY 4.0 by the author.