Gitea is an open source version control platform similar to Gitbub… It’s probably the easiest, fastest, and most painless way of setting up a self-hosted Git service….
Gitea is a clone of Gogs and is 100% open source and free of charge…. All source code is available under the MIT License on GitHub…. It is robuts, scalable and a great alternative to other git services…
Gitea has rich features like issues and time tracking, repository branching, file locking and tagging, merging and many others features that you will find in a typical source control platform..
Gitea streamlines your collaborative workflows. Visualize, prioritize, coordinate, and track your progress your way with Gitea’ flexible project management tools.
This brief tutorial is going to show students and new users how to easily install Gitea on Ubuntu 16.04 and 18.04…
To install Gitea on Ubuntu, follow the steps below
Step 1: Install MariaDB
Gitea requires a database server to store it content… and MariaDB is a great place to start with looking for an open source database server…
After that, run the commands below to secure MariaDB server by creating a root password and disallowing remote root access.
When prompted, answer the questions below by following the guide.
Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
Restart MariaDB server
Now that you’ve installed all the packages that are required for Gitea to function, continue below to start configuring the servers…. First run the commands below to create a blank Gitea database and database user….
To logon to MariaDB database server, run the commands below.
sudo mysql -u root -p
Change the GLOBAL innodeb_file_per_table to On..
SET GLOBAL innodb_file_per_table = ON;
Then create a database called gitea
CREATE DATABASE gitea;
Create a database user called giteauser with new password
CREATE USER 'giteauser'@'localhost' IDENTIFIED BY 'new_password_here';
Then grant the user full access to the database.
GRANT ALL ON gitea.* TO 'giteauser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;
Next, run the commands below to update the database character set..
ALTER DATABASE gitea CHARACTER SET = utf8mb4 COLLATE utf8mb4_unicode_ci;
Finally, save your changes and exit.
Next, run the commands below to open MariaDB default config file…
After installing MariaDB above, you should run the commands below to create a new user account for Gitea… The account directory will be used as a working directory for Gitea… To create the account, run the commands below…
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Environment=USER=gitea 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
Save the file and exit
Install Git package on Ubuntu by running the commands below…
sudo apt install git
After that, reload systemd and start Gitea service
To enable Gitea service to start when your system boots, run the commands below
sudo systemctl enable gitea
Run the status command to see Gitea status page..
sudo systemctl status gitea
You should see the text below:
● gitea.service - Gitea (Git with a cup of tea)
Loaded: loaded (/etc/systemd/system/gitea.service; enabled; vendor preset: en
Active: active (running) since Wed 2018-10-10 14:15:28 CDT; 19ms ago
Main PID: 17769 (gitea)
Tasks: 4 (limit: 2321)
├─17769 /usr/local/bin/gitea web -c /etc/gitea/app.ini
└─17774 /usr/local/bin/gitea web -c /etc/gitea/app.ini
Next, open your browser and browse to the server hostname or IP address followed by port 3000
Type in the database connection info and continue with the setup…
Login and enjoy!
After the installation, you should be able to logon and use Gitea as a git service…