Gitea is a self-hosted Git service which is written in Go language. It is similar to Gitlab or Github. In this tutorial, we will discuss how to install Gitea on Fedora CoreOS latest.
Before proceeding with the installation, ensure that you have the following requirements:
First, update the system by running the following commands:
sudo dnf upgrade -y
sudo reboot
The reboot command will restart the system after the updates have been applied.
To install Gitea, navigate to the temporary directory:
cd /tmp
Download the latest version of Gitea using the following command:
wget https://dl.gitea.io/gitea/1.14.4/gitea-1.14.4-linux-amd64
Rename the downloaded binary to gitea
and make it executable:
mv gitea-1.14.4-linux-amd64 gitea
sudo chmod +x gitea
Move the Gitea binary to /usr/local/bin
:
sudo mv gitea /usr/local/bin/
Create a new systemd service for Gitea by creating a new file called gitea.service
in the /etc/systemd/system/
directory:
sudo nano /etc/systemd/system/gitea.service
Paste the following content into the file:
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
After=postgresql.service
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web
Restart=always
Environment=USER=gitea HOME=/var/lib/gitea
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
Save and close the file.
Create a new user and group for Gitea by running the following commands:
sudo useradd -r -s /bin/false gitea
sudo groupadd git
sudo useradd -r -g git gitea
Create the required directories for Gitea by running the following commands:
sudo mkdir -p /var/lib/gitea/
sudo chown -R gitea.git /var/lib/gitea/
sudo chmod -R 770 /var/lib/gitea/
Start and enable the Gitea service by running the following commands:
sudo systemctl start gitea.service
sudo systemctl enable gitea.service
You can verify the status of the Gitea service by running the following command:
sudo systemctl status gitea.service
Gitea listens on port 3000 by default. Allow incoming traffic to this port by running the following command:
sudo firewall-cmd --add-port=3000/tcp --permanent
sudo firewall-cmd --reload
Open your web browser and navigate to http://<your-server-ip>:3000/
, where <your-server-ip>
is the IP address of your Fedora CoreOS instance. You should see the Gitea login page.
Enter the username and password of the Gitea administrator account and click the "Sign In" button. You will be redirected to the Gitea dashboard. Congratulations! You have successfully installed and configured Gitea on your Fedora CoreOS instance.
In this tutorial, we have discussed how to install Gitea on Fedora CoreOS latest. Gitea is now installed as a systemd service and can be started, stopped, and managed like any other service using the systemctl command.
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!