Compose file for personal instance of Forgejo
Find a file
2026-05-24 20:17:46 +02:00
.env.dist build: Add vars in compose file 2026-05-24 20:17:46 +02:00
.gitignore build: Add vars in compose file 2026-05-24 20:17:46 +02:00
docker-compose.yml build: Add vars in compose file 2026-05-24 20:17:46 +02:00
readme.md build: Add vars in compose file 2026-05-24 20:17:46 +02:00

Forgejo conf

Configuration for my instance of Forgejo using podman and podman-compose.

Prerequisite

  • podman & podman-compose installed

  • The domain/subdomain for the forge, here git.marcha.me

  • Open ports 22, 80, 443, 2222

Deployment

Clone the repository in a dedicated folder. Copy .env.dist into a new .env file and set up the variables accordingly

Run podman-compose up -d Stop with podman-compose down

SSH configuration

To use git with SSH, you'll need an SSH key

ssh-keygen -t ed25519 -a 100

Copy/Paste the public key in Forgejo. Then on your device, update your ssh config:

nano ~/.ssh/config

Add the following

Host forge        
 User git
 IdentityFile ~/.ssh/git
 Hostname git.marcha.me
 Port 2222

SSH for the forge is now working in using git@forge. Ex: git clone git@forge:Matt/ecofse.git ecofse

SSL

SSL is setup on a very basic conf with let's encrypt (see ACME environment vars in compose file)

Running locally

When running locally, adjust the compose file as following :

  • switch FORGEJO__server__ENABLE_ACME to false and FORGEJO__server__PROTOCOL to http
  • if running with rootless podman, update ports for them to be >1024