Operations

GitLab vs GitHub for teams that must keep source code in-country

If your team operates under a regulatory or contractual obligation to keep source code in-country, the choice of collaboration platform is not just about features, it is about where your data physically lives. Public cloud SaaS platforms like GitHub store your repositories on infrastructure that may span multiple jurisdictions, and even if you select a specific region, you are still subject to the provider's global terms. The alternative is running a self-hosted instance of GitLab Community Edition (CE) on a Vietnam VPS with a dedicated IPv4, giving you full root access to the underlying server and complete control over the storage location. This article compares the two approaches for teams that need their code to stay inside Vietnam's borders.

Why "keep source code in country" matters in 2026

The requirement to keep source code within national borders is not theoretical. Vietnam's Decree 53 (which governs data storage for foreign-invested entities) and cross-sector regulations around banking, telecom, and government IT mandate that certain categories of data, including application source code for regulated services, reside on infrastructure physically located inside Vietnam. Teams that serve Vietnamese users or partner with Vietnamese state-owned enterprises must demonstrate compliance during audits. Beyond regulatory pressure, operational latency matters: a GitHub repository hosted in Singapore or the US adds measurable delay to every clone, push, and CI pipeline for a development team sitting in Hanoi or Ho Chi Minh City. A self-hosted GitLab instance on a domestic VPS with domestic bandwidth of 100 Mbps eliminates both the compliance gray zone and the round-trip latency.

GitHub does offer Enterprise Cloud with a data residency option (GitHub AE, though that product has seen limited adoption and unclear support timelines), but it places your source code inside Microsoft Azure infrastructure in a defined geography, and not every geography is supported. As of 2026, Azure's Vietnam datacenters remain limited in scope; enterprise-grade Azure regions near Vietnam are in Singapore or East Asia, not inside the country. For D33-level compliance, "in Southeast Asia" is not the same as "in Vietnam."

Self-hosted GitLab CE on a Vietnam VPS, what you control

Running GitLab CE on a rented VPS from a local provider gives you direct authority over the hardware that holds your repositories. The setup is well-documented: you provision a Linux VPS (Ubuntu 24.04 LTS or Debian 12), install the GitLab CE package via the official repository, point a domain at the dedicated IPv4, and configure HTTPS with Let's Encrypt. The server sits inside a Tier 3 datacenter, such as those operated by Viettel IDC (Viettel's telecom and data arm) or VNPT IDC (the data center division of the state-owned postal and telecom group), where physical access is logged, power is backed by UPS and generators, and the network is domestic.

The VPS itself runs on KVM virtualization with NVMe storage. Plans range from the entry-level VNLite (1 vCPU, 2 GB RAM, 20 GB NVMe) up to the VNx8 (8 vCPU, 16 GB RAM, 100 GB NVMe), all provisioned with a dedicated IPv4 from the Vietnam address pool. The domestic bandwidth is 100 Mbps on a 1 Gbps port, enough for a team of 10 to 30 developers to push code, review merge requests, and run CI runners without bottlenecks, as long as the team is primarily inside Vietnam. International bandwidth (which matters if remote developers connect from outside the country) is a shared pool of roughly 4 to 10 Mbps, sufficient for intermittent remote access and repository mirroring but not for a globally distributed team treating the Vietnam VPS as their primary Git host. For teams whose developers are inside Vietnam, the 100 Mbps domestic pipe is the critical number; all traffic to and from the instance stays within domestic backbones operated by Viettel IDC, VNPT IDC, FPT Telecom, and CMC Telecom (the four major telecom infrastructure providers in Vietnam), keeping latency under 10 ms for most users in the country.

The operational trade-off is maintenance. You manage OS updates, GitLab version upgrades (major releases approximately every month), database backups of the PostgreSQL backend, and SSL certificate renewal. GitLab CE does include a built-in backup rake task, sudo gitlab-rake gitlab:backup:create, that you can schedule via cron. VPS providers typically offer a snapshot and backup feature at the hypervisor level, giving you an additional recovery path. For a team without a dedicated DevOps role, staying current with GitLab releases is noticeable work, but no more than maintaining any other production Linux server.

GitHub, the SaaS convenience with a jurisdiction gap

GitHub, owned by Microsoft, is the most widely used code collaboration platform globally. Its strength is zero-ops: you sign up, create a repository, and everyone on the team sees it immediately. Code reviews via pull requests, Actions for CI/CD, GitHub Copilot for AI-assisted development, and the entire ecosystem of third-party integrations are available with no server management. For a team that must keep source code in-country, GitHub Enterprise Cloud with data residency places your repositories in a designated Azure region, but not inside Vietnam. The closest data residency option is Singapore. From a Vietnamese compliance officer's perspective, that means the code is outside the country's borders, hosted by a foreign entity under foreign jurisdiction, accessible to the host's employees and subject to Microsoft's global security policies rather than Vietnam's data protection regulations.

GitHub Enterprise Server (the on-premises appliance) is a different product: you deploy it on your own infrastructure inside Vietnam, on a Linux server that you control. That removes the jurisdiction gap, but it introduces the same operational overhead as GitLab CE, you maintain the server, apply patches, manage backups, while carrying significantly higher licensing costs (GitHub Enterprise Server starts at a per-user annual fee that, for a team of ten, can exceed the cost of a year of VPS rental with a dedicated IPv4 by a large margin). GitLab CE is open source under the MIT Expat license with zero per-user licensing cost. The total cost of running GitLab CE on a Vietnam VPS is the server rental plus your own labor for maintenance.

Key architectural differences that affect in-country teams

CriteriaGitLab CE (self-hosted on Vietnam VPS)GitHub (SaaS / Enterprise Cloud)
Physical data locationServer in a Vietnam Tier 3 datacenter; full control over which rack, which datacenter, which physical diskStored in Microsoft Azure regions; no Vietnam region available in 2026; closest is Singapore or East Asia
JurisdictionVietnamese law directly governs the server; team can sign a colocation or VPS agreement with a Vietnamese provider that specifies storage within the countrySubject to Microsoft's standard terms and the jurisdiction of the Azure region; code may be accessed by Microsoft employees for operational purposes
Network latency (team inside Vietnam)Domestic bandwidth 100 Mbps on a 1 Gbps port; sub-10 ms latency for push/fetch from Vietnam-based developersCross-border route from Vietnam to Singapore or further; typical latency 50 to 100 ms depending on ISP peering
CI/CD runnersRunners can run on the same VPS or on separate VPS instances inside Vietnam; all build artifacts stay inside the countryGitHub Actions runs on Microsoft's infrastructure; build VMs are in the region you select (Singapore at best) and build artifacts may be cached across regions
Licensing costZero (MIT Expat); you pay only for the VPS / dedicated serverGitHub Enterprise: per-user monthly fee; free tier limits private repos to small teams but lacks compliance guarantees
Maintenance effortMedium: OS updates, GitLab upgrades, PostgreSQL management, SSL renewals, backup monitoringLow to zero on SaaS; Enterprise Server shifts work back to the team with a higher license cost
Backup and disaster recoverySnapshot-based backups at the VPS hypervisor level + GitLab built-in backup; restore takes restoring the VM or running the backup commandGitHub provides repository-level redundancy across Azure zones; no user-accessible full backup of the instance besides cloning all repos
Integration ecosystemLarge but self-configured; GitLab has built-in CI/CD, container registry, and a Kubernetes integration; third-party integrations via webhooksLargest ecosystem; GitHub Actions, Apps, Marketplace, Copilot, all work out of the box on the SaaS plan

When to pick self-hosted GitLab CE over GitHub

A team that must keep source code in-country should choose self-hosted GitLab CE when the following conditions are met:

  • The team is primarily based inside Vietnam and can use the domestic 100 Mbps bandwidth for daily operations.
  • Compliance requires a documented assurance that source code never leaves Vietnam's borders, not even for build execution, caching, or backup replication.
  • The team has at least one person comfortable maintaining a Linux server (installing packages, editing config files in /etc/gitlab/, managing a postgresql database, and running apt update && apt upgrade periodically).
  • Budget is a concern, GitLab CE on a VNx4 or VNx8 plan (4 vCPU / 8 GB RAM to 8 vCPU / 16 GB RAM, ideal for a team of 10-30) costs orders of magnitude less per year than per-user licensing for GitHub Enterprise.

Deploying GitLab CE on a GitLab VPS with a dedicated Vietnam IPv4 is a common setup: you get full root access, a clean reverse DNS record that can be set on your dedicated IP, and the ability to stack monitoring, a local Docker registry, and CI runners on the same infrastructure block. The same VPS can run n8n for automation workflows alongside GitLab, or host a local mirror of third-party packages, all inside Vietnam.

When GitHub is still the better fit

GitHub makes more sense when your team is globally distributed, because the international bandwidth from a Vietnam VPS is limited to a shared pool of roughly 4 to 10 Mbps, and developers in Europe or North America will feel the latency on every operation. In that scenario, the compliance requirement may need to be handled differently, through contractual assurances with Microsoft's legal team and a careful reading of your regulatory obligations. If the regulation genuinely permits hosting in a nearby geography (Singapore, Japan) rather than requiring local hosting, GitHub Enterprise Cloud with data residency in Singapore may satisfy the auditor while saving your team the overhead of running a server. Another scenario: if your team heavily uses GitHub Copilot (which sends code context to Microsoft's inference servers), self-hosting on a Vietnam VPS does not remove that data flow unless you disable Copilot entirely.

For teams that truly need to keep source code in-country and can stomach a modest amount of server maintenance, GitLab CE on a Vietnam VPS is the more direct, lower-cost, and more auditable solution. GitHub Enterprise Server is an alternative with the same on-premises deployment model, but the per-user license cost makes it hard to justify unless the team already has a Microsoft enterprise agreement or requires features not available in GitLab CE (such as GitHub Actions' Marketplace ecosystem, which GitLab's built-in CI/CD covers with a different syntax).

FAQ

Can GitHub Enterprise Cloud guarantee that my source code never leaves Vietnam?

No. GitHub Enterprise Cloud with data residency places your repositories in an Azure region you select, but Microsoft does not operate an Azure region inside Vietnam as of 2026. The closest region is Singapore or East Asia, and code stored there is subject to the jurisdiction of that region's laws and Microsoft's operational access policies.

What is the minimum Vietnam VPS spec to run GitLab CE for a team of 10?

For 10 active users with frequent CI pipelines, start at 4 vCPU and 8 GB RAM (the VNx4 plan at thueVPS), with at least 50 GB of NVMe storage. GitLab CE's official hardware recommendations state 4 GB RAM as the minimum, but with PostgreSQL and CI runners sharing the same server, 8 GB is safer.

How do I back up a self-hosted GitLab instance on a Vietnam VPS?

Use GitLab's built-in backup rake task: sudo gitlab-rake gitlab:backup:create. This backs up the PostgreSQL database, repositories, and configuration. Schedule it via cron and copy the resulting tarball to a separate storage volume or off-site. Most VPS providers also offer hypervisor-level snapshots as a second backup layer.

Does self-hosting GitLab CE exclude us from using GitHub Actions or Copilot?

Yes, GitLab CE includes its own CI/CD engine (configured via .gitlab-ci.yml), which covers most of what GitHub Actions does. Copilot is a separate Microsoft service that sends code context to external servers; you cannot use it with a self-hosted GitLab instance without also sending code outside your server, which defeats the purpose of keeping source code in-country.

What if my team grows beyond 30 developers, will a single VPS still work?

At that scale, consider horizontally separating the GitLab application server, the PostgreSQL database, and the CI runners onto separate VPS instances, or move to a dedicated server with higher core and RAM counts. A single VNx8 (8 vCPU / 16 GB RAM) can serve 30-50 developers with moderate CI usage before PostgreSQL becomes the bottleneck.

Bài viết liên quan

自建 GitLab 与 GitHub 的越南源代码合规存储对比

对于需要将源代码保留在越南境内的团队,自建 GitLab CE 在越南 VPS 上是更直接、更低成本的方案。GitHub Enterprise Cloud 目前没有越南的 Azure 区域,代码实际存储在新加坡或东亚。自建方案使用越南数据中心(如 Viettel IDC、VNPT IDC)的 KVM VPS,配备专属越南 IPv4、100 Mbps 国内带宽和 NVMe 存储,团队可完全控制数据物理位置。维护工作量中等,但零许可费用的优势明显。如果团队主要在越南境内工作,自建 GitLab CE 是满足第 53 号法令合规要求的最务实选择。

Note: This guide is for general reference. Every system and infrastructure has its own specifics, so test each step in a safe environment and consult a qualified engineer before applying it in production.