Host Your Own GitHub Alternative with Gitea on Windows 🌱

What is Gitea?

Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket, and GitLab. Gitea is a fork of Gogs. -https://docs.gitea.io/en-us/

Installing Gitea

  1. Open a browser and navigate to https://dl.gitea.io/gitea
  2. Open the folder for the latest release
  3. Download the latest windows .exe release
  4. Download Git for Windows Download
  5. Install Git for Windows
  6. Rename the downloaded gitea .exe file gitea.exe
  7. Copy/cut gitea.exe
  8. Navigate to C:\Program Files and create a new folder called gitea
  9. Paste gitea.exe inside the new gitea folder
  10. Hold SHIFT and right click in the white space > Open PowerShell window here...
  11. Run the following commands in the PowerShell window
    # create subdirectories
    $(New-Item -Force -Type Directory '.\data')
    $(New-Item -Force -Type Directory '.\log')
    # create basic ini configuration
    "RUN_USER = $ENV:ComputerName`$`r`nAPP_NAME = Git`r`nRUN_MODE = prod`r`n`r`n[ui]`r`nDEFAULT_THEME = arc-green" | Out-File -Encoding utf8 -FilePath "$(New-Item -Force -Type Directory 'C:\Program Files\gitea\custom\conf')\app.ini"
    # run gitea as a service
    New-Service -Name "Gitea" -BinaryPathName '"C:\Program Files\gitea\gitea.exe" web --config "C:\Program Files\gitea\custom\conf\app.ini"' -StartupType "Automatic" -Description "Gitea"
    # start the gitea service
    Start-Service "Gitea"

Initial Configuration

  1. Open a web browser and navigate to http://DNSorIP:3000
  2. Set the database type to SQLite3 on the Initial Configuration screen > Click the Install Gitea button
  3. Click the Register Now link
  4. Enter a username, email and password > Click the Register Account button
  5. Welcome to Gitea

Documentation: https://docs.gitea.io/en-us/windows-service/