Switch Guide: Moving from GitHub to Self-Hosted Gitea (Hosted in Canada)
GitHub is owned by Microsoft — a US corporation subject to US data laws, including the CLOUD Act. For Canadian development teams working on government contracts, healthcare software, or anything with explicit data residency requirements, this creates real risk. Self-hosted Gitea on Canadian infrastructure is the clean solution: a lightweight, open-source Git hosting platform that you run on your own server, on Canadian soil, under Canadian jurisdiction.
Why Self-Host in Canada?
The key advantage is jurisdictional clarity. When you run Gitea on a Canadian VPS (cloud server), your source code, commit history, issue tracker, and pull requests are all stored on hardware in Canada, subject only to Canadian law. No US government subpoena can compel a Canadian VPS provider to hand over your data the way Microsoft is obligated to respond to US federal requests. For development teams working on government systems, financial software, or health data platforms, this matters significantly.
What You'll Gain
- Full data sovereignty: Your code lives on your server, in Canada. No third party has access without your permission.
- Lower cost: A Canadian VPS with 2 vCPUs and 4GB RAM costs roughly $15–$25/month — enough to run Gitea for a team of 20. Compare to GitHub Team at $4 USD/user/month (plus currency conversion).
- GitHub-compatible workflow: Gitea supports the same Git workflow, pull requests, issues, code review, and webhooks your team already uses.
- Built-in CI/CD via Gitea Actions: Gitea has an Actions system compatible with GitHub Actions syntax — your existing workflows may migrate with minimal changes.
- No lock-in: It's Git. You can mirror to GitHub or move to any other Git host at any time.
What You Might Miss
- GitHub's ecosystem: GitHub has deep integrations with almost every developer tool. Gitea's integration ecosystem is smaller — verify your key tools support Gitea webhooks or API.
- GitHub Pages, Packages, Codespaces: These GitHub-specific services don't exist in Gitea. You'll need alternatives (a CDN for pages, a registry for packages, a dev environment solution).
- Maintenance overhead: You own the server. You're responsible for updates, backups, and uptime. Budget 1–2 hours/month for maintenance.
- GitHub Actions marketplace: GitHub has 20,000+ community actions. Gitea Actions works but the marketplace is smaller — some custom work may be needed.
Recommended Canadian Hosting
Several reputable Canadian VPS providers work well for Gitea hosting:
- ThinkOn — Enterprise-grade, 100% Canadian, excellent for regulated industries.
- Hetzner (Toronto region) — Cost-effective, reliable, Toronto data centre.
- Canadian web hosting providers — Many smaller Canadian hosts offer VPS with guaranteed Canadian data centres.
Migration Checklist
- Provision your Canadian VPS — Choose Ubuntu 22.04 LTS, minimum 2 vCPU / 4GB RAM for teams up to 20 people.
- Install Gitea — Follow Gitea's official installation guide. The binary install is the simplest: download the binary, create a git user, configure systemd service.
- Configure domain and HTTPS — Point a subdomain (e.g., git.yourcompany.ca) at your VPS. Use Certbot (Let's Encrypt) for free SSL/TLS.
- Mirror your GitHub repositories — In Gitea, use Explore → Migrate → GitHub to import repos with full history, issues, and pull requests. Gitea's GitHub migration tool is excellent.
- Create user accounts — Add your team members. Gitea supports LDAP/AD, OAuth, and local accounts.
- Migrate CI/CD — Review your GitHub Actions workflows. Gitea Actions supports the same YAML syntax — copy your workflow files to
.gitea/workflows/and test. Adjust any GitHub-specific actions to Gitea-compatible equivalents. - Update repository remotes — Each developer runs
git remote set-url origin https://git.yourcompany.ca/org/repo.gitto switch their local remotes. - Redirect GitHub webhooks — Update any external services (deployment pipelines, Slack bots, etc.) that use GitHub webhooks to use your new Gitea webhook URLs.
- Archive GitHub repos — Archive (don't delete) your GitHub repos for 90 days as a safety net.
- Set up automated backups — Configure daily Gitea backups to an offsite Canadian storage location (ThinkOn, Sync.com, etc.).
Timeline Estimate
Small team (under 10 devs, under 20 repos): A skilled DevOps engineer can complete the full migration in 1–2 days. Larger teams or complex CI/CD: Budget 1–2 weeks for migration plus testing. The repository migration itself is fast — it's the CI/CD audit and workflow updates that take time.