Gitea Mirror hero image

Backup Your GitHub
To Self-Hosted Gitea

Automatic, private, and free. Own your code history forever. Preserve issues, PRs, releases, and wiki in your own Gitea server.

It also mirrors from GitLab, Gitea and Forgejo, including Codeberg, and can push to GitHub, GitLab and Forgejo. Those paths are in beta. GitHub to Gitea is the supported default.

Self-Hosted Backup
Automated Syncing
$0/month
GitLab, Forgejo and Codeberg in beta
Gitea Mirror - Automated github to gitea repository mirroring & backup | Product Hunt

Everything You Need for Reliable Backups

Everything to keep your code safe and reachable, whichever host it lives on today.

Automated Mirroring

Set it and forget it. Repositories sync to Gitea on a schedule, new ones are picked up automatically, and the dashboard shows every run live.

Multiple SourcesBeta

GitHub is the default. GitLab, Gitea and Forgejo, including Codeberg, work too: code, branches, tags, wiki and LFS come across from any of them.

Push to GitHub or GitLabBeta

Neither host offers a pull mirror, so the app keeps a bare clone and pushes branches and tags. The copy always matches the source.

Metadata Preservation

From GitHub, mirror issues, pull requests, releases, labels, milestones and wiki pages alongside your code. Choose how many releases carry their assets.

Force-Push Protection

Detect upstream force-pushes and automatically snapshot repos before destructive changes.

Git LFS Support

Mirror large files and binary assets alongside your repositories with full LFS support.

API Keys

Create a key, send it in the x-api-key header, and drive the same endpoints the UI uses from CI, cron or n8n: list, add, mirror, sync.

Cleanup and Reconcile

Archive or delete mirrors whose source is gone, adopt mirrors you made by hand, and reset rows whose copy went missing. Nothing is deleted without you.

Secure & Self-Hosted

Tokens encrypted at rest with AES-256-GCM. Run it with Docker, the Helm chart on ghcr.io, Nix or Proxmox. Your code stays on your infrastructure.

Use Cases

Proven Ways Teams Depend on Gitea Mirror

Explore real-world workflows where automated mirroring removes risk, accelerates migrations, and keeps engineering teams shipping.

Backup GitHub Repositories

Continuously mirror GitHub repositories into self-hosted Gitea so your side projects stay safe even when GitHub hiccups.

Pain Point
Homelabbers rely on GitHub availability but want local backups that preserve history, metadata, and LFS assets.
Outcome
Automated syncs capture full repository history, metadata, and file storage so you always have an up-to-date local copy.
RedundancyContinuous SyncHomelab
Read the playbook

Deploy with Helm Chart

Install the project on Kubernetes in a few commands using the maintained Helm chart to keep your backup mirror humming.

Pain Point
Self-hosters want reproducible Git backups without hand-rolling manifests for every cluster or upgrade.
Outcome
Versioned Helm values capture backup config, making redeploys and upgrades fast, scriptable, and low-risk.
KubernetesHelmHomelab
Read the playbook

Spin Up on Proxmox LXC

Run the one-liner Proxmox VE script to launch gitea-mirror inside a tuned LXC container for your lab backups.

Pain Point
Proxmox homelabbers want a repeatable Git backup without manually wiring containers, volumes, and services.
Outcome
The community script provisions the container, installs Bun, and wires persistence so mirroring works minutes after boot.
ProxmoxAutomationHomelab
Read the playbook

See It In Action

A clean, intuitive interface designed for efficiency and ease of use

Dashboard Overview

Dashboard Overview

Monitor all your mirrored repositories in one place

Swipe left or right to navigate

Get Started in Minutes

Choose your preferred installation method

1

Clone the repository

git clone https://github.com/RayLabsHQ/gitea-mirror.git && cd gitea-mirror
2

Start with Docker Compose

docker compose -f docker-compose.alt.yml up -d
3

Access the application

# Open http://localhost:4321 in your browser

First user becomes admin. After installation, create your account and configure GitHub and Gitea connections through the web interface.

FAQ

Common Questions About GitHub Backups

What people ask about self-hosted repository backups with Gitea Mirror, and about the newer GitLab, Forgejo, GitHub and API paths.

What is Gitea Mirror and why do I need it?

Gitea Mirror is a self-hosted tool that automatically backs up your GitHub repositories to your own Gitea server. GitHub outages, account issues, or policy changes can lock you out of your code. With Gitea Mirror you own your backups completely: no monthly fees, no third-party storage, and full control over your repository history, issues, pull requests, and releases. It can also pull from GitLab, Gitea and Forgejo, and push to GitHub, GitLab and Forgejo, all in beta.

Which hosts can it mirror from and to?

Sources: GitHub is the default. GitLab and Gitea or Forgejo, which covers Codeberg, are available in beta. Destinations: Gitea is the default. Forgejo, GitHub and GitLab are available in beta. Each account uses one source and one destination at a time. GitHub to Gitea is the supported path; every other combination works end to end but has had less time in the field, so it carries a beta label in the dropdowns.

Read about sources and destinations
Can it push to GitHub or GitLab?

Yes, in beta. Neither host offers a usable pull mirror, so the app keeps a bare clone of each repository and pushes its branches and tags there with force and prune. The copy always matches the source and is overwritten on every sync, so treat it as read only. Issues, pull requests, releases, wiki and LFS objects do not travel to push targets. The GitHub token needs the repo and workflow scopes; the GitLab token needs api and write_repository.

How push destinations work
How is this different from BackHub or Rewind?

BackHub and Rewind are cloud services that cost $600-2400/year and store your code on their servers. Gitea Mirror is free, open source, and runs on your own infrastructure. You pay $0/month and have complete data ownership. The tradeoff: you manage the infrastructure yourself, while cloud services are fully managed.

Does Gitea Mirror backup issues, pull requests, and releases?

Yes, from GitHub. Enable 'Mirror metadata' in settings to backup issues with comments, labels, and assignees. Pull requests are mirrored as enriched issues with full metadata, commit history, and file changes (Gitea's API doesn't support creating PRs from external sources). Releases, including binary assets, and wiki pages are also backed up when enabled, and the 'Assets for latest' setting limits asset uploads to the newest releases. Other sources carry code, branches, tags, wiki and LFS only.

Is there an API?

Yes. Create an API key under Configuration, Authentication, API Keys and send it in the x-api-key header. A key uses the same endpoints as the web UI: list repositories, add one by owner and name, start a mirror, sync, run cleanup, reconcile, and check health. Keys can expire, can be revoked, and cannot create or revoke other keys.

API reference
How long does setup take?

15-20 minutes with Docker. Run 'docker compose -f docker-compose.alt.yml up -d', visit localhost:4321, create an account, paste your GitHub and Gitea tokens, select repos to backup, and you are done. The Proxmox LXC one-liner is even faster. No complex configuration files or manual scripting required.

How do I install it with Helm?

The chart is published to GitHub Container Registry with every release: helm upgrade --install gitea-mirror oci://ghcr.io/raylabshq/charts/gitea-mirror --namespace gitea-mirror --create-namespace. The chart version equals the application version and its default image tag is that release, so a plain install runs the newest version. Installing from a clone of the repository still works.

Deployment guide
I already have mirrors on Gitea. Can Gitea Mirror take them over?

Yes. The Reconcile action on the Automation tab compares your Gitea server with the database. Mirrors it does not know about, whose original URL points at your configured source, can be adopted as tracked rows. Rows whose mirror has gone missing can be reset so the next run recreates them. Native repositories and mirrors of other hosts are listed but never touched, and nothing is deleted on either side.

Cleanup and reconcile
What happens if GitHub goes down or I lose access?

You can immediately clone from your Gitea server instead. Your local backups include full commit history, branches, tags, issues, releases, everything. Recovery time is typically under 2 minutes (just point git to your Gitea URL). This is why it's called disaster recovery, not just mirroring.

How often does it sync?

Configurable from every 15 minutes to once per day (or longer). Most users choose 1-8 hours based on how fresh they want backups. The scheduler auto-discovers new repos and respects per-repo intervals, unlike Gitea's built-in mirroring which defaults to 24 hours. Push destinations run the same schedule.

Can I backup starred repositories?

Yes! Gitea Mirror can automatically backup the repositories you have starred on your source host into a dedicated Gitea organization. Perfect for preserving important open source projects before they disappear (projects get deleted, renamed, or removed all the time).

What are the system requirements?

Minimal: 2 vCPU, 2GB RAM, 5-10GB storage (grows with repo count). Runs on Docker, Kubernetes, Proxmox LXC, or bare metal. Works on AMD64 and ARM64 (Raspberry Pi compatible). A small homelab server or cheap VPS is plenty for personal use. Push destinations keep a bare clone per repository on disk, so budget roughly the size of those repositories on top.

Are my tokens stored securely?

Yes. All source and destination tokens are encrypted at rest using AES-256-GCM. Even if someone gains access to the SQLite database, they can't read your tokens without the encryption key. Set the ENCRYPTION_SECRET environment variable to control that key. Push targets receive tokens through a git credential helper, never in a URL or on disk.

Can I backup private repositories?

Absolutely. Use a GitHub personal access token (classic) with the 'repo' scope, a GitLab token with read_api and read_repository, or a Gitea or Forgejo token with read:repository, read:user and read:organization. Gitea Mirror will backup the repositories you have access to: public, private, and internal.

What if I have multiple GitHub organizations?

Gitea Mirror supports multiple organizations with flexible destination strategies: preserve GitHub structure in Gitea, consolidate into a single org, or use mixed mode (personal repos in one place, org repos preserve structure). Edit individual organization destinations via the dashboard.

Does it support Git LFS (large files)?

Yes! Enable 'Mirror LFS' in settings. Make sure your Gitea server has LFS enabled (LFS_START_SERVER = true) and Git v2.1.2+. Large assets like videos, datasets, and binaries are backed up alongside your code. LFS objects are not pushed to GitHub or GitLab destinations yet.

How do I restore from backup?

Simple: 'git clone https://your-gitea-server/owner/repo.git'. Your full history, branches, and tags are there. For issues/PRs/releases, they're already in Gitea's web interface. For complete disaster recovery, restore the data volume to a fresh Gitea Mirror instance and everything (config, sync history) is preserved.

Can I run this alongside a cloud backup service?

Yes! Many users run Gitea Mirror for local/warm backups while using cloud services for offsite redundancy. Best of both worlds: instant local recovery and geographic disaster protection. Totally compatible.

Is this enterprise-ready with SLA guarantees?

No. Gitea Mirror is a community open source project with no 24/7 support, no compliance certifications, and no guaranteed uptime. It's perfect for homelabs, indie developers, and small teams comfortable with self-hosting. If you need enterprise SLAs, consider commercial solutions like BackHub or GitHub Enterprise Backup.

Still have questions?Ask in our GitHub Discussions

Start Protecting Your Code Today

Join developers who trust Gitea Mirror to keep their repositories safe and accessible. Free, open source, and ready to deploy.

Loading...

Gitea Mirror is licensed under GPL-3.0.View License