The website for
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.6 KiB

<!DOCTYPE html>
<html lang="en">
<link href="/styles/default.css" rel="stylesheet" type="text/css" />
Installing Gitea
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<div id="wrapper">
<div id="header">
Installing Gitea
<div id="layout">
<div id="navigation">
<p class="link">
<a href="/index.html">
<p class="link">
<a href="/about.html">
About Me
<p class="link">
<a href="/contact.html">
Contact Me
<!--<p class="link">
<a href="/cv.html">
<p class="link">
<a href="">
My Blog
<div id="content">
<p>We have most of the prerequisites installed for gitea, and we could download the binary and run it as we are, but we want this to be a daemon (a process that runs in the background, and doesn't need an interactive shell open to run in) so we need to create a system user for it, and set it up as a service. We will also need to create the config files, and directory structure that Gitea expects. (most of the following is taken from the documentation at <a href="" title="Gitea Documentation">Gitea's documentation pages</a> with a few minor tweaks)</p>
<pre>sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /var/lib/gitea \
sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown git:git /var/lib/gitea/{data,indexers,log}
sudo chown git:git /var/lib/gitea
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
wget -O gitea
sudo chown root:root gitea
sudo mv gitea /usr/local/bin/
sudo chmod +x /usr/local/bin/gitea
sudo -u git /usr/local/bin/gitea web -c /etc/gitea/app.ini</pre>
<p>At this point you should be able to visit your git domain in a web browser, in this guide, and configure gitea through the installation page.</p>
<p>Most of the settings can be left as their defaults, with the following exceptions,
<ul>Config changes from defaults
<li>In Database settings you need to enter the Database password you set for the gitea user of the database</li>
<li>In General Application Settings change the LFS Root Path to "/var/lib/gitea/data/lfs"</li>
<li>Change Domain to the FQDN you are using ( in this guide)</li>
<li>Change Application URL to HTTPS at your domain ( in this guide)</li>
<li>Change Log Path to "/var/lib/gitea/log"</li>
<li>In the Optional Settings, expand Email Service Settings and set SMTP Host to "localhost:25"</li>
<li>Set From to something like ""</li>
<li>Tick both Enable Register Confirmation and Enable Mail Notifications</li></ul>
<p>The remaining Settings are your choice, click install Gitea and the config file will be created and Gitea will be configured. Once done the gitea process will stop, and we need to make the config secure.</p>
<pre>sudo chmod 750 /etc/gitea
sudo chmod 644 /etc/gitea/app.ini</pre>
<p>We now have a configured Git server, there just remain a few steps to get it ready to go into service.</p>
<p style="text-align:center;"><a href="/guides/building-a-git-repo/installdb.html" title="Installing a Database">Installing a Database</a>|<a href="/guides/building-a-git-repo/" title="Building A git Repository Server">Main Page</a>|<a href="/guides/building-a-git-repo/finalising.html" title="Finalising Everything">Finalising Everything</a></p>