Skip to content

Instantly share code, notes, and snippets.

@appleboy
Last active January 20, 2024 09:48
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save appleboy/36313a525fbef673f8aefadb9c0f8247 to your computer and use it in GitHub Desktop.
Save appleboy/36313a525fbef673f8aefadb9c0f8247 to your computer and use it in GitHub Desktop.
how to install gitea in Ubuntu/Debian.

Gitea

Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read this blog post.

Run Gitea service

Download Gitea binary from download page first.

$ wget https://dl.gitea.io/gitea/1.1.0/gitea-1.1.0-linux-amd64 -O gitea
$ chmod +x gitea

Add git user

$ useradd -m git
$ cp gitea /home/git/

Run gitea command as git user. default port is 3000.

$ su - git
$ ./gitea web

Run Caddy service

Download Caddy binary from github release page.

$ wget https://github.com/mholt/caddy/releases/download/v0.9.5/caddy_linux_amd64.tar.gz -O caddy.tar.gz
$ mkdir caddy && tar -zxvf caddy.tar.gz -C caddy

Create caddy config file with name as Caddyfile and add the following config.

example.com {
  proxy / 127.0.0.1:3000
}

Update Gitea config file custom/conf/app.ini.

[server]
SSH_DOMAIN       = example.com
HTTP_PORT        = 3000
ROOT_URL         = https://example.com

Integrate with Jenkins

Install Jenkins Gitea Webhook Plugin.

Open your browser

https://example.com

@cbrgm
Copy link

cbrgm commented Feb 19, 2018

Thanks for the explanation! 👍

@hypervtechnics
Copy link

What about supervisor?

@xoroz
Copy link

xoroz commented Mar 14, 2018

thank you! so easy, and I was having a hard time trying to compile it.

@mckaygerhard
Copy link

mckaygerhard commented Mar 27, 2018

now packaging https://software.opensuse.org//download.html?project=home%3Avegnuli%3Agolang&package=gitea permits run as deamon service

debian sid has also gitea but 1.3, the link above has 1.5 (lasted master)

@VictorLamoine
Copy link

VictorLamoine commented May 9, 2018

@appleboy you might want to add $ passwd git after $ useradd -m git

You also probably want to upgrade to 4.1.0 the download link!

@AloisMahdal
Copy link

Neat, works like a charm! A bit off-topic: anyone knows how to integrate it as apache vhost? I use Host: based routing, so I guess I need to somehow tell Apache to serve gitea.myexample.org from this localhost:3000...?

@48cf
Copy link

48cf commented Jun 7, 2018

@AloisMahdal what about nginx? 🤔

@maneeshkush
Copy link

We hope this post helped you to find out How to Install Gitea on Ubuntu 18.04
https://www.mstvlife.com/how-to-install-gitea-on-ubuntu-18-04/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment