Skip to content

Forgejo

Docker Apps Rating
U/GID TZ SSO/Users Existing FS Portable Subfolder Mobile
✅👪

Install

services:
  forgejo:
    image: codeberg.org/forgejo/forgejo:12
    container_name: forgejo
    environment:

      - USER_UID=${PUID}
      - USER_GID=${PGID}
      - SSH_PORT=222
      - FORGEJO__server__SSH_DOMAIN=forgejo
    restart: unless-stopped
    networks:
      - public
    volumes:
      - ~/docker/forgejo:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '3022:3000'
      - '222:222'

networks:
  public:
    external: true
  • the SSH_PORT and 222:222 are used so the display clone URL work as expected
  • similarly the FORGEJO__server__SSH_DOMAIN=forgejo

Configuration

Follow the GUI for configs (e.g. username, password, base URL)

SSH

Fix permission issue on Windows

ssh-keygen -f forgejo -e -m pem

SSH config file for Forgejo

Host forgejo
  User git
  Hostname 10.10.120.12
  Port 222
  IdentityFile C:\\Users\\hubcc\\.ssh\\forgejo

Simply clone the SSH repo URL is enough

git clone ssh://git@forgejo/user/ACIT-2520.git

Mirror to Github

https://forgejo.org/docs/latest/user/repo-mirror/#setting-up-a-push-mirror-from-forgejo-to-github
This is done per project.

  • Settings > Repository > Mirror Settings

Comments