Gitea is a self-hosted Git service similar to GitHub, GitLab, and Bitbucket. It is written in Go and is lightweight, fast, and easy to use. In this tutorial, we will show you how to install Gitea on POP! OS Latest.
Before we start with the installation, ensure that you have the following:
To start with the installation, let's introduce the dependencies required by Gitea:
$ sudo apt update
$ sudo apt install -y git sqlite3 certbot
Navigate to the official Gitea website https://gitea.io
and download the latest stable release for Linux AMD64 by clicking on the link displayed.
Next, create a new directory for Gitea:
$ sudo mkdir /var/lib/gitea && sudo chown $USER:$USER /var/lib/gitea
$ cd ~
$ tar -zxvf gitea-*-linux-amd64.tar.gz
$ sudo mv gitea-* /var/lib/gitea/gitea
$ sudo ln -s /var/lib/gitea/gitea/gitea /usr/local/bin/gitea
$ sudo nano /etc/systemd/system/gitea.service
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
# Requires mariadb/mysql
# Requires=mysqld.service
# Requires=mariadb.service
# Requires=mysql.service
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /var/lib/gitea/custom/conf/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024 uncomment
# the two values below
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable gitea.service
$ sudo systemctl start gitea.service
To use HTTPS with your Gitea installation, you can use Let's Encrypt to generate free SSL certificates.
$ sudo apt-get install certbot
$ sudo systemctl stop gitea.service
$ sudo certbot certonly --standalone -d example.com
Replace example.com with your domain name.
$ sudo systemctl start gitea.service
In this tutorial, we showed you how to install and set up Gitea on POP! OS Latest. To get started with using Gitea, navigate to http://localhost:3000
in your favorite web browser.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!