How to Install Gitea on Void Linux
Gitea is an open-source git hosting platform that is easy to use, lightweight, and has a low resource footprint. In this tutorial, we will guide you through the steps for installing Gitea on Void Linux.
Step 1: Update the System
Before we start the installation process, we need to make sure our system is up to date by running the following commands:
sudo xbps-install -S
sudo xbps-install -u
These commands will update the package manager and upgrade all installed packages on the system.
Step 2: Install Required Dependencies
Gitea requires several dependencies to be installed on the system before it can be installed. To install the required dependencies, run the following command:
sudo xbps-install -S git go nodejs npm sqlite
Step 3: Download Gitea
Next, we need to download Gitea. You can download it from the official website or by running the following command:
wget https://dl.gitea.io/gitea/<version>/gitea-<version>-linux-amd64.tar.gz
Replace <version> with the desired version of Gitea.
Extract the downloaded tar.gz file using the following command:
tar xvf gitea-<version>-linux-amd64.tar.gz
This will extract the Gitea files in a directory named gitea-<version>.
Step 4: Configure Gitea
Create a new user for Gitea by running the following command:
sudo useradd -m -s /bin/bash git
Next, create a new directory that will store the Gitea repositories:
sudo mkdir /var/lib/gitea
sudo chown git:git /var/lib/gitea
Create a new configuration file named app.ini in the Gitea configuration directory:
sudo mkdir /etc/gitea
sudo nano /etc/gitea/app.ini
Add the following lines to the app.ini file:
[server]
ROOT_URL = https://<your-domain>
SSH_DOMAIN = <your-domain>
[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gitea
USER = gitea
PASSWD = a-secure-password
SSL_MODE = disable
[repository]
ROOT = /var/lib/gitea
Replace <your-domain> with the domain name or IP address you will use to access the Gitea web interface.
Step 5: Install Gitea
To install Gitea, move the extracted gitea-<version> directory to the /usr/local/ directory:
sudo mv gitea-<version> /usr/local/gitea
Next, symlink the Gitea binary to the /usr/local/bin directory:
sudo ln -s /usr/local/gitea/gitea /usr/local/bin/gitea
Finally, start the Gitea service by running the following command:
sudo systemctl enable gitea
sudo systemctl start gitea
Step 6: Access Gitea
You can access Gitea by visiting https://<your-domain> in your web browser. You will be prompted to create a new admin account, after which you can start using Gitea.
Congratulations! You have successfully installed Gitea on Void Linux.