How to Install Gogs Git on AlmaLinux 10
This tutorial will walk you through the steps to install the Gogs self-hosted Git service on an AlmaLinux 10 server. Gogs (Go Git Service) is a painless, lightweight, and self-hosted Git service with a simple setup process.
Prerequisites
- Full root SSH access or sudo privileges
- A server running AlmaLinux 10
- Basic understanding of Linux terminal usage
Supported databases:
- SQLite3
- PostgreSQL
- MySQL/MariaDB
Update Your System
dnf update -y
Install MariaDB Server
dnf install mariadb-server mariadb -y
Enable and start MariaDB:
systemctl enable --now mariadb
Check MariaDB status:
systemctl status mariadb
Secure MariaDB
mysql_secure_installation
Follow prompts to set root password and secure the installation.
Create Gogs Database and User
Log in to MariaDB:
mariadb -u root -p
Run the following SQL commands:
SET GLOBAL innodb_file_per_table = ON;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost' IDENTIFIED BY 'StrongPassword';
FLUSH PRIVILEGES;
EXIT;
Download and Extract Gogs
Navigate to /usr/local/bin
:
cd /usr/local/bin
Download the latest release:
dnf install wget -y
curl -s https://api.github.com/repos/gogs/gogs/releases/latest | \
grep browser_download_url | grep 'linux_amd64.tar.gz' | \
cut -d '"' -f 4 | wget -i -
Install tar (if not installed):
dnf install tar -y
Extract Gogs archive:
tar -xvzf gogs_*_linux_amd64.tar.gz
Create Git User and Setup Directories
adduser git
mkdir /var/log/gogs
chown -R git:git /var/log/gogs/
mv gogs /home/git/
chown -R git:git /home/git/
Install Git: Run this as root:
dnf install git -y
Disable Firewalld (or allow port manually)
systemctl stop firewalld
systemctl disable firewalld
(Alternatively, allow port 3000 or 3001 via firewall-cmd if you want firewall running.)
Run Gogs
Switch to the Gogs directory:
cd /home/git/gogs
Start Gogs:
./gogs web
To run on a custom port (e.g., 3001):
./gogs web -port 3001
Access Gogs Web Interface
Open your browser and visit:
http://your-server-ip:3000
Or:
http://your-server-ip:3001
📸 Gogs Setup Screens (From AlmaLinux 9 – still valid)
✅ Congratulations! You’ve successfully installed and run Gogs on AlmaLinux 10.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS