Back to all templates
Forgejo logo

Forgejo

Development256MB+ RAM

Community-driven Gitea fork

gitversion-controlgitea-fork

Deploy Forgejo in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Forgejo

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Terminal Deployment

Forgejo CLI Deployment

Deploy Forgejo the traditional way with SSH and Docker Compose.

1

Access Your VPS via Terminal

Open a terminal session and log into your VPS. Replace the placeholder with your actual IP.

terminal
# Connect via SSH
ssh root@your-vps-ip

# Alternative with key file
ssh -i /path/to/key root@your-vps-ip

First time? Make sure Docker is installed on your VPS. Run: curl -fsSL https://get.docker.com | sh

2

Set Up Project Folder

Create a workspace for your deployment files.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/forgejo
cd ~/apps/forgejo
3

Create the Compose File

Configure your containers with this Docker Compose setup:

docker-compose.yml
services:
  forgejo:
    image: codeberg.org/forgejo/forgejo:7
    ports:
      - "3000:3000"
      - "2222:22"
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - FORGEJO__database__DB_TYPE=postgres
      - FORGEJO__database__HOST=db:5432
      - FORGEJO__database__NAME=forgejo
      - FORGEJO__database__USER=forgejo
      - FORGEJO__database__PASSWD=<your-db-password>
    volumes:
      - forgejo_data:/data
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=forgejo
      - POSTGRES_PASSWORD=<your-db-password>
      - POSTGRES_DB=forgejo
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U forgejo"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  forgejo_data:
  postgres_data:
Deployment Settings
PORTWeb port(default: 3000)
SSH_PORTSSH port(default: 2222)
DB_PASSWORDDB password
4

Deploy Your Stack

Spin up the containers and verify the deployment.

terminal
# Start all services
docker compose up -d

# List running containers
docker compose ps

# Watch the logs
docker compose logs -f
5

Update Firewall Settings

Allow incoming traffic on the application port.

terminal
# Allow the application port through firewall
sudo ufw allow 3000/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:3000
Skip the Terminal

Skip the terminal. Use Server Compass instead.

Server Compass makes deploying Forgejo effortless. Visual setup, one-click deploy, done.

  • Beautiful interface
  • One-click deploys
  • Let's Encrypt SSL
  • Zero downtime
  • Container monitoring
  • Easy rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying Forgejo with Server Compass, complete these steps to finish setup

1

Complete installation wizard

2

Create admin account

3

Create repos

Need help? Check out our documentation for detailed guides.

Forgejo FAQ

Common questions about self-hosting Forgejo

How do I deploy Forgejo with Server Compass?

Simply download Server Compass, connect to your VPS, and select Forgejo from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Forgejo?

Forgejo requires a minimum of 256MB RAM. We recommend a VPS with at least 1024MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Forgejo data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Forgejo backup and restore procedures.

How do I update Forgejo to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Forgejo image will be pulled and deployed with zero downtime.

Is Forgejo free to self-host?

Forgejo is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Forgejo?

Download Server Compass and deploy Forgejo to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass