Forgejo

From 44Net Wiki
Revision as of 01:43, 11 September 2026 by KN6DWI (talk | contribs) (Instruct users on opening Forgejo ports in their firewall)

Forgejo is an open source git forge that aims to implement federation using the ActivityPub protocol. It can be self-hosted to provide code collaboration services similar to GitHub, such as remote git repositories, issue tracking, and pull/merge requests.

Step 0 (Optional): Change your SSH to a nonstandard port

Git forges provide the ability to interact via HTTP or SSH. If you want users to interact with your Forgejo instance using the standard SSH port, and you have an existing SSH server on the same device, you must move your regular SSH server to another port. Forgejo supports SSH over other ports, but all of your users will have to specify that port in their git clone commands or configure it in their ~/.ssh/ssh_config file.

To change your SSH port, edit /etc/ssh/sshd_config, uncomment the line starting with Port, and change the number to something other than 22. Open the corresponding port in your firewall. For more information on firewall configuration, see Firewalling Basics.

Step 1: Install Forgejo

Go to the delightful forgejo repository and check whether Forgejo has been packaged for your operating system or distribution. If so, install using your package manager. Otherwise, go to the Forgejo installation page(https://forgejo.org/releases/) , decide whether you're going to install from binary or from a docker container, and follow the corresponding instructions. Make sure you complete initial setup before moving to the next step.

Step 2: Open Forgejo ports in your firewall

If you installed using Docker or Docker Compose, and want to use nonstandard ports, change the Docker port mappings. You will not need to open the ports in your firewall, because Docker port mappings are done via an iptables chain that takes precedence over user-configured rules. This means ports mapped using Docker will be immediately publicly accessible once you enable your 44Net Connect tunnel, so don't enable it until you've completed initial setup.

If you installed Forgejo from a binary, the ports used for the web UI are not editable from the web UI. Instead, edit the config file at /etc/forgejo/app.ini, and change the HTTP_PORT and SSH_PORT lines. Then, open the corresponding ports in your firewall. The default ports are 3000 for the web UI, and 222 for SSH. For more information on firewall configuration, see Firewalling Basics.

Note that you cannot put the web UI on the same port as Forgejo's SSH access.

Step 3: Set up 44Net Connect tunnel

Step 4: Validate Forgejo functionality

Troubleshooting