<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thibble.org/goomba/index.php?action=history&amp;feed=atom&amp;title=Forgejo_Install_from_Binary</id>
	<title>Forgejo Install from Binary - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thibble.org/goomba/index.php?action=history&amp;feed=atom&amp;title=Forgejo_Install_from_Binary"/>
	<link rel="alternate" type="text/html" href="https://wiki.thibble.org/goomba/index.php?title=Forgejo_Install_from_Binary&amp;action=history"/>
	<updated>2026-07-29T01:08:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.thibble.org/goomba/index.php?title=Forgejo_Install_from_Binary&amp;diff=8&amp;oldid=prev</id>
		<title>T20A02: Created page with &quot;Installation:  Download Forgejo binary for your CPU architecture and verify the GPG signature. Copy the binary to /usr/local/bin/ and make it executable. # cp forgejo-1.21.5-0-linux-amd64 /usr/local/bin/forgejo # chmod 755 /usr/local/bin/forgejo Ensure git and git-lfs are installed: # apt install git git-lfs Create a user git on the system: # adduser --system --shell /bin/bash --gecos &#039;Git Version Control&#039; \   --group --disabled-password --home /home/git  git Create nece...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.thibble.org/goomba/index.php?title=Forgejo_Install_from_Binary&amp;diff=8&amp;oldid=prev"/>
		<updated>2024-08-30T03:06:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Installation:  Download Forgejo binary for your CPU architecture and verify the GPG signature. Copy the binary to /usr/local/bin/ and make it executable. # cp forgejo-1.21.5-0-linux-amd64 /usr/local/bin/forgejo # chmod 755 /usr/local/bin/forgejo Ensure git and git-lfs are installed: # apt install git git-lfs Create a user git on the system: # adduser --system --shell /bin/bash --gecos &amp;#039;Git Version Control&amp;#039; \   --group --disabled-password --home /home/git  git Create nece...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Installation:&lt;br /&gt;
&lt;br /&gt;
Download Forgejo binary for your CPU architecture and verify the GPG signature.&lt;br /&gt;
Copy the binary to /usr/local/bin/ and make it executable.&lt;br /&gt;
# cp forgejo-1.21.5-0-linux-amd64 /usr/local/bin/forgejo&lt;br /&gt;
# chmod 755 /usr/local/bin/forgejo&lt;br /&gt;
Ensure git and git-lfs are installed:&lt;br /&gt;
# apt install git git-lfs&lt;br /&gt;
Create a user git on the system:&lt;br /&gt;
# adduser --system --shell /bin/bash --gecos &amp;#039;Git Version Control&amp;#039; \&lt;br /&gt;
  --group --disabled-password --home /home/git  git&lt;br /&gt;
Create necessary directories for Forgejo:&lt;br /&gt;
# mkdir /var/lib/forgejo&lt;br /&gt;
# chown git:git /var/lib/forgejo &amp;amp;&amp;amp; chmod 750 /var/lib/forgejo&lt;br /&gt;
&lt;br /&gt;
# mkdir /etc/forgejo&lt;br /&gt;
# chown root:git /etc/forgejo &amp;amp;&amp;amp; chmod 770 /etc/forgejo&lt;br /&gt;
Optional: Set up database: (If not using SQLite)&lt;br /&gt;
&lt;br /&gt;
Follow Forgejo&amp;#039;s Database Preparation guide for setup.&lt;br /&gt;
Install systemd service for Forgejo:&lt;br /&gt;
&lt;br /&gt;
Download the systemd service script:&lt;br /&gt;
# wget -O /etc/systemd/system/forgejo.service https://codeberg.org/forgejo/forgejo/raw/branch/forgejo/contrib/systemd/forgejo.service&lt;br /&gt;
Enable and start the Forgejo service:&lt;br /&gt;
# systemctl enable forgejo.service&lt;br /&gt;
# systemctl start forgejo.service&lt;br /&gt;
Forgejo&amp;#039;s web-based configuration:&lt;br /&gt;
&lt;br /&gt;
Access Forgejo in your browser at http://git.example.com:3000/.&lt;br /&gt;
If encountering issues, check service status and logs:&lt;br /&gt;
# systemctl status forgejo.service&lt;br /&gt;
# journalctl -n 100 --unit forgejo.service&lt;br /&gt;
Follow on-screen instructions to complete initial configuration.&lt;br /&gt;
Further configuration in Forgejo&amp;#039;s app.ini:&lt;br /&gt;
&lt;br /&gt;
Stop Forgejo service:&lt;br /&gt;
# systemctl stop forgejo.service&lt;br /&gt;
Make /etc/forgejo/ and app.ini read-only for the git user:&lt;br /&gt;
# chmod 750 /etc/forgejo &amp;amp;&amp;amp; chmod 640 /etc/forgejo/app.ini&lt;br /&gt;
Edit /etc/forgejo/app.ini to adjust configurations.&lt;br /&gt;
&lt;br /&gt;
Start Forgejo service again:&lt;br /&gt;
&lt;br /&gt;
# systemctl start forgejo.service&lt;br /&gt;
General hints for using Forgejo:&lt;br /&gt;
&lt;br /&gt;
Run Forgejo CLI as the git user.&lt;br /&gt;
Specify Forgejo work path and config path.&lt;br /&gt;
Optionally, create a script for easier CLI usage:&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
sudo -u git forgejo -w /var/lib/forgejo -c /etc/forgejo/app.ini &amp;quot;$@&amp;quot;&lt;br /&gt;
Make it executable:&lt;br /&gt;
# chmod 755 /usr/local/bin/forgejo.sh&lt;br /&gt;
Now, Forgejo commands can be executed simply by calling forgejo.sh [command].&lt;br /&gt;
&lt;br /&gt;
To turn the script into a service for systemctl, follow these steps:&lt;br /&gt;
&lt;br /&gt;
Open the forgejo.service file for editing:&lt;br /&gt;
sudo nano /etc/systemd/system/forgejo.service&lt;br /&gt;
Update the file to include the User directive:&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Forgejo Command Line Interface&lt;br /&gt;
After=network.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=simple&lt;br /&gt;
User=git&lt;br /&gt;
ExecStart=/usr/local/bin/forgejo.sh&lt;br /&gt;
Restart=on-failure&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
Save and close the file.&lt;br /&gt;
&lt;br /&gt;
Reload systemd to read the new service file:&lt;br /&gt;
&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
Enable and start the forgejo service:&lt;br /&gt;
sudo systemctl enable forgejo.service&lt;br /&gt;
sudo systemctl start forgejo.service&lt;br /&gt;
Now, the forgejo.sh script will be executed with the git user permissions when managed by systemctl.&lt;/div&gt;</summary>
		<author><name>T20A02</name></author>
	</entry>
</feed>