This template allows deploying a forgejo en either Scaleway or Hetzner (untested) without much knowledge about them. It DOES require knowledge about Terragrunt and ansible. A wizard of sorts is provided but it will not guarantee success without some knowledge about the underlying technology.
3.7 KiB
3.7 KiB
Quick Start Guide - 15 Minutes to Forgejo
Get your Forgejo instance running in 15 minutes.
Prerequisites Check (2 minutes)
# Install required tools (if not installed)
# macOS:
brew install terraform terragrunt ansible
# Ubuntu/Debian:
sudo apt-get install terraform ansible # (or look for instructions to do this using a virtualenv for ansible)
curl -L https://github.com/gruntwork-io/terragrunt/releases/download/v0.50.0/terragrunt_linux_amd64 -o /usr/local/bin/terragrunt
chmod +x /usr/local/bin/terragrunt
# Verify installations
make check-deps
Step 1: Cloud Provider Setup (3 minutes)
Option A: Scaleway
- Create account at https://console.scaleway.com
- Generate API credentials: Console → IAM → API Keys
- Export credentials:
export SCW_ACCESS_KEY="SCW..."
export SCW_SECRET_KEY="..."
export SCW_DEFAULT_PROJECT_ID="..." #bear in mind, you might want a project ID other than the default
Option B: Hetzner
- Create account at https://console.hetzner.cloud
- Generate API token: Security → API Tokens
- Export token:
export HCLOUD_TOKEN="..."
Step 2: Configuration (5 minutes)
Configure Domain
# terraform/scaleway/compute/terraform.tfvars (or hetzner)
domain_name = "git.yourdomain.com"
Generate Secrets
# Generate strong passwords
openssl rand -base64 32 # Database password
openssl rand -base64 32 # Admin password
openssl rand -base64 48 # Secret key
openssl rand -base64 48 # Internal token
openssl rand -base64 48 # JWT secret
Configure Secrets
cd ansible/playbooks/vars
cp secrets.yml.example secrets.yml
# Edit with generated passwords
$EDITOR secrets.yml
# Encrypt
ansible-vault encrypt secrets.yml
# Enter vault password (remember this!)
Update Inventory
$EDITOR ansible/inventory/production/hosts.yml
Change:
forgejo_domain: git.yourdomain.comletsencrypt_email: your@email.com
Step 3: Deploy (5 minutes)
# Create infrastructure
make terraform-apply PROVIDER=scaleway # or hetzner
# Get server IP
make terraform-output PROVIDER=scaleway
# Create DNS A record
# git.yourdomain.com → <server-ip>
# Wait 2 minutes for DNS propagation
# Update inventory with server IP
$EDITOR ansible/inventory/production/hosts.yml
# Change: ansible_host: <your-server-ip>
# Deploy Forgejo
make deploy
# Enter vault password when prompted
Step 4: Access (1 minute)
Visit: https://git.yourdomain.com
First Login:
- Complete installation wizard
- Login with admin credentials from vault
- Create your first repository!
Next Steps
- Configure SSH key: Settings → SSH Keys
- Create organization
- Import repositories
- Set up webhooks
- Configure CI/CD with Forgejo Actions
- Invite team members
Troubleshooting
Can't connect to server?
make ansible-ping
SSL certificate not working?
- Wait 5 minutes for Let's Encrypt
- Check DNS:
dig git.yourdomain.com
Service not starting?
make logs
make status
Need to start over?
make terraform-destroy PROVIDER=scaleway
# Then start from Step 3
Daily Operations
# Create backup
make backup
# Update Forgejo
make update
# View logs
make logs
# SSH into server
make ssh
# Check health
make health
Cost Per Month (in January 2026)
- Scaleway: ~€9/month
- Hetzner: ~€8/month
vs GitHub Enterprise: €19/user/month
Support
- Check logs:
make logs - View status:
make status - Full docs:
README.md - Troubleshooting:
README.md#troubleshooting
That's it! You now have a production-ready Forgejo instance running on European infrastructure. 🎉