Gitea on Docker vs Kubernetes vs VMs

Gitea on a single Docker host or a VM suits most small and mid-sized teams, while Kubernetes suits organizations that already run clusters and GitOps. The deciding factors are database high availability, upgrade discipline and who carries the pager.

On this page

Gitea on Docker, Kubernetes or VMs: which model fits which team

A single Docker host fits a small team that already runs containers, serves one Gitea instance to a bounded group of users and can accept that the host is a single point of failure. A VM fits a team that already patches Linux servers on a routine schedule but has no container platform to operate. Kubernetes fits an organization that already runs clusters, has persistent storage it trusts and keeps people on call for the cluster itself. Choose the model by asking who will answer the page at 2 a.m. and which skills that person already has. The paragraphs below set out the conditions under which each model is the better choice.

Docker on one host is the better choice when the repository data, the database and the configuration can be backed up and restored by a routine your team has already tested, and when a longer outage during a host rebuild is acceptable to the business. Confirm which database engine you plan to use, since Gitea supports MySQL, PostgreSQL, SQLite and MSSQL, and confirm which one your load and your backup tooling support. A VM is the better choice when your hypervisor already provides snapshots, replication and a backup agent, because those controls then apply to Gitea the same way they apply to your other internal services. Ask your platform team which of these controls they already audit, since an existing control usually costs less to extend than a new one costs to build.

Kubernetes is the better choice only when the cluster is a service your organization already runs well. Gitea needs persistent storage for repositories and a database that survives pod rescheduling, so check that your storage class, backup tool and restore test cover those volumes. Confirm in the Gitea documentation which configuration your planned version supports for more than one replica before you count on high availability. Expect to own the manifests or chart, the ingress and the upgrade sequence for both the cluster and Gitea. Gitea Cloud, the managed option Gitea offers alongside self-hosted installs, shifts much of that operating load to the provider under the terms you agree, and it is covered on the sibling page on self-hosted versus managed Gitea.

How Gitea on VMs and on Kubernetes compare across the factors that matter

This table compares how Gitea runs on virtual machines and on Kubernetes across sizing, availability, upgrades, backup, monitoring, skills, cost and team fit. Read each row as the work your team would own, and use the confirm notes as questions for your vendor contacts. Running Gitea in Docker on a single host is covered in the architecture section.

FactorGitea on VMsGitea on Kubernetes
SizingSize each VM for Gitea and its database role, then resize or split roles as users and repositories grow.Set CPU and memory requests per pod and size persistent volumes for repositories. Test with your own workload.
High availabilityPlan database failover with Patroni on PostgreSQL. Confirm Gitea's multi-node storage requirements before adding a second node.Pod replicas across nodes, with CloudNativePG handling PostgreSQL failover via the Kubernetes API. Confirm storage access modes before running more than one Gitea replica.
UpgradesIn-place upgrade in a maintenance window after a tested backup. Rollback means restoring the previous binary and data.Change the image tag in Git and let Argo CD or Flux roll it out. Confirm rollback after schema migrations before upgrading.
BackupBack up the database, repository data and configuration together, with consistent snapshots. Restore-test the set on a spare host.Back up PersistentVolumes, the PostgreSQL cluster and manifests or Helm values in Git. Restore-test all three together.
MonitoringHost agents plus Prometheus or Zabbix for CPU, disk, Gitea service and database checks.Prometheus scraping node, pod and Gitea metrics, with Alertmanager routing alerts. Cluster components add to the watch list.
Operating skillsLinux administration, service management, database administration and load balancer configuration.Kubernetes objects, storage classes, ingress, RBAC, plus the Linux and database skills underneath.
Cost driversNumber of VMs and their storage, a standby database node, and staff time for patching each host.Control plane and worker nodes, persistent storage, and the platform time to run the cluster itself, plus GitOps tooling if adopted.
LicensingGitea is MIT licensed. Gitea Enterprise from CommitGo, with SAML 2.0 and audit logging, applies on either path.Same MIT license and Enterprise option. Confirm with CommitGo that Enterprise terms cover your Kubernetes setup.
Team that fitsA small team that runs Linux VMs today and wants fewer moving parts for one service.A platform team already operating clusters that can absorb Gitea as one more workload.

What each Gitea deployment model runs, component by component

Each deployment model runs the same Gitea service but places the database, repository storage and restart logic in different components. The four cards below list what each model needs around the Gitea process, so you can check which pieces you already run and which you would have to build, back up and patch.

Single Docker host

A single Docker host runs the Gitea container, its data volume and, if you choose, a database container on one machine. This model has the fewest moving parts to stand up, and SQLite is a workable database here because one node holds the live data. The host is the failure domain: a disk fault, a failed kernel update or a misconfigured container takes Git access down for everyone. Check where repository data and the database sit on the host's volumes, whether your backups capture both consistently, and how you restore onto a second host.

One or more virtual machines

On virtual machines, Gitea runs as a service under the guest operating system, with repositories on the VM's disk and the database on the same VM or on another one. One VM behaves much like a single Docker host. Two or more VMs raise a question the single-host model never asks: can the instances share repository storage and reach the same database? Confirm the multi-instance layout in the Gitea documentation before you size the VMs or place a load balancer in front of them, and agree who patches each guest.

Kubernetes cluster

Kubernetes adds scheduling, rolling updates, ingress and secret handling around Gitea, and the cluster is a separate system with its own control plane, etcd, networking and upgrade cycle. Gitea's availability now depends on the cluster layer as well as the application. Check who patches the cluster, how Gitea pods come back after a node failure, and how HTTPS and SSH traffic reach the service through your ingress or load balancer. Confirm the chart or manifests you plan to use against the Gitea documentation before committing, since the team that runs the cluster becomes part of the Gitea operating model.

External database and storage

Gitea documents MySQL, PostgreSQL, SQLite and MSSQL as database options, and SQLite fits a single node. A second instance is where the database and repository storage choices change, so Docker, VM and Kubernetes layouts all need a plan for shared state. Confirm with the Gitea documentation whether multiple instances need an external database and shared repository storage in the version you deploy. Ask who backs up the database and where repository files are kept, because each model can lose one without the other.

Gitea documentation

How Gitea, its database, runners and backups connect in each model

The diagram starts outside the client network, where developers use Git and the web and Gitea Actions runners register and poll for jobs. Both reach a load balancer or reverse proxy inside the trust boundary, which forwards traffic to one or more Gitea instances. Each instance reads and writes a PostgreSQL cluster run either by Patroni on VMs or by CloudNativePG on Kubernetes, depending on the model you choose. Repository data stays in its own storage, and database backups go to a separate target. Check that the proxy, the database and the backup target sit where your security team expects, and that runners can reach the proxy without a path into the database.

The client network is the trust boundary, and backups leave it for a separate target.

How Gitea high availability depends on the database and shared storage

Gitea high availability is only as strong as the layers under it, because its state is split between a database and repository data on disk. Account, permission and issue metadata lives in the database, which Gitea supports as MySQL, PostgreSQL, SQLite or MSSQL, while repository data sits on the filesystem where the instance runs. Running more than one instance therefore means solving two problems: keeping the database available through a node failure, and making repository data visible to every instance that might serve a request. Before you size a Docker, Kubernetes or VM layout, confirm with the Gitea documentation which multi-instance layout is supported and what storage that layout requires.

For PostgreSQL on VMs or Docker hosts, Patroni is the tool to evaluate first. It is an MIT-licensed PostgreSQL high availability tool that runs PostgreSQL 9.3 to 18 and uses a distributed configuration store to coordinate the leader: ZooKeeper, etcd, Consul or Kubernetes. That store is a dependency you must operate, so it adds components to patch, back up and monitor alongside the database nodes. Confirm that your Gitea release supports the PostgreSQL major version you plan to run and that this version falls within the range Patroni supports. The Patroni documentation describes the configuration store options and failover behavior you will need to test.

On Kubernetes, CloudNativePG is an Apache-2.0 operator in the CNCF Sandbox that manages PostgreSQL directly through PersistentVolumeClaims, without a StatefulSet layer, and it uses the Kubernetes API server to fail over without an external configuration store. That removes one component compared with a Patroni deployment, but it ties your database upgrade schedule to the operator release cycle and to the storage class you select. For repository data, the open question is shared storage: confirm whether your Gitea layout needs a volume type that supports multiple writers, and test how those volumes are backed up and restored. The CloudNativePG documentation explains the failover and storage model you will be working with.

How a Gitea upgrade runs on each model, step by step

The sequence below shows what an upgrade involves on Docker, Kubernetes and virtual machines, in the order the work happens. Each step names what to do and the check that closes it, so the team can see where the three models differ and where they share the same gates. The sequence produces a tested upgrade path, a rollback option and a sign-off record.

  1. Read release notes for the target line

    Start with the release notes for the target line. For this upgrade that means the v28 releases, v28.0.0 on September 29, 2026 and v28.1.0 on October 6, 2026, and the v1.27 line, whose v1.27.3 shipped on August 29, 2026, if you are still running it. Your team lists breaking changes, database migration notes, configuration keys and runner compatibility for each model. Confirm support windows for each line on the Gitea release pages before choosing a target. Done when the change record names a target version and an owner.

  2. Back up the database and repositories

    Take a database dump and a repository backup before anything changes, and store both outside the host being upgraded. On Docker, that means the database container's dump plus the volumes that hold repositories and attachments. On Kubernetes, it means a database dump plus a snapshot of the persistent volume claims, and on VMs, a dump plus a copy of the app data directory and the configuration file. Use the backup tooling in the Gitea documentation for your version, such as the dump command, and confirm what it captures for that version. Done when a test restore into a scratch environment completes and logs in.

  3. Rehearse the upgrade in staging

    Run the full upgrade on a staging copy built from the production backup and the same database engine, image tag, Helm values or OS package set. Staging should match production in the parts that change behavior: Gitea version, database, reverse proxy, SSO settings and the Actions runner version. Record how long each step took and every error, then repeat the run until it completes cleanly. Done when staging passes the checks in the later steps, and the rehearsal log becomes the production runbook.

  4. Roll the change through the workload

    Apply the new version through the model you run, in the agreed maintenance window. On Docker, pin the new image tag in the Compose file and recreate the container, keeping the previous tag noted for rollback. On Kubernetes, change the image tag in the Helm values or manifest through your normal deployment path, and check the rollout strategy first, because shared storage and one-time database migrations limit how many pods can safely run during the change. On VMs, stop the systemd service, replace the binary or package, and start it again. Done when the service reports the target version and the web UI and Git over SSH respond.

  5. Verify repositories after the upgrade

    Check the data path before the platform goes back to users. Clone a sample of repositories over HTTPS and SSH, push a test commit, open a pull request, review a diff, and confirm a package from the package registry still installs. Compare the repository and user counts against the backup baseline, and check that attachments and LFS objects open. Done when a named owner has signed off the checklist, with each result recorded.

  6. Confirm webhooks and Actions runners

    Test the integrations that depend on Gitea, since failures there often go unnoticed in the web UI. Open the webhook delivery history for a sample of repositories and confirm new deliveries return success codes to their targets, then redeliver one event to be sure. Check that each Actions runner reconnects to the upgraded instance, that it runs a workflow triggered by a push, and that its version is supported with the new release, as the release notes state. Done when a test workflow passes on each runner pool and every webhook target has received a fresh event.

  7. Keep the rollback path until sign-off

    Hold the rollback path open until the checks pass, then close it on purpose. On Docker, keep the previous image tag and a restorable volume copy. On Kubernetes, keep the previous Helm release revision or commit so the change can be reverted through the same pipeline. On VMs, keep the previous binary and the pre-upgrade database dump. If the old binary cannot read a schema change made by the new one, restoring the dump is the likely route back, so record that in the runbook. Done when the change record has a closed rollback decision, a retention period agreed with the owner, and the sign-off.

Upgrades, backups, monitoring and skills for each Gitea model

This table compares how Gitea on VMs and Gitea on Kubernetes differ in upgrades, backups, metrics, alerting, skills and on-call work. Each row describes the work your team takes on under each model, so use it as an operating checklist. The main takeaway is that Kubernetes adds layers to triage and automate, while VMs keep fewer moving parts but leave more recovery steps to your team.

FactorGitea on VMsGitea on Kubernetes
Upgrade methodReplace the binary or package on one host, restart the service, and keep a tested rollback copy. Check release notes for your target version first.Change the image tag in manifests or Helm values through your pipeline. Confirm migration steps and rollout behavior for the target version first.
Backup approachBack up the configured database (MySQL, PostgreSQL, SQLite or MSSQL) and the repository data directory together so they stay consistent. Test restores on a separate host.Back up the database through its operator or external service, and back up repository storage volumes separately. Confirm volume snapshot support in your storage class.
Metrics collectionPrometheus, which is Apache-2.0 licensed, pulls metrics over HTTP from each host. Confirm which Gitea metrics endpoint and authentication setting your version exposes.Prometheus pulls metrics over HTTP from the Gitea pod through a scrape configuration, alongside cluster metrics. Confirm the endpoint and authentication setting for your version.
AlertingPrometheus sends alert conditions to Alertmanager, which routes notifications to your paging tool. Host-level rules cover disk, memory and service health.The same Prometheus and Alertmanager pattern applies, with added rules for pod restarts, node pressure and volume capacity.
Skills the team needsLinux administration, service management, reverse proxy and TLS setup, database operations, and hands-on restore testing.Kubernetes operations, Helm or manifest management, persistent volume handling, plus the Linux and database skills the pods still depend on.
On-call loadPages usually trace to one host, disk or database process. Recovery steps are host-level and usually run by hand unless you automate them.Pages can come from the cluster, the node, the storage class or the application. The runbook must name the owner of each layer.
What to confirm firstUpgrade notes for your target version, the restore time your business can accept, and whether your database is on the supported list.Storage class snapshot support, who maintains the chart or manifests, and whether the platform team or the application team owns on-call.

What moving Gitea between deployment models costs later

Moving Gitea between a Docker host, a virtual machine and Kubernetes is mostly a data and addressing exercise. The state to carry across is the database (MySQL, PostgreSQL, SQLite or MSSQL, whichever you run), the repository and attachment directories, and the configuration file, including the ROOT_URL value that Gitea uses to build clone links. Every place that URL appears changes at cutover: developer remotes, CI pipelines, webhooks in other systems and OAuth or SAML callbacks. SSH access needs its own check, since clients cache host keys. Runners are registered against an instance URL, so confirm whether they must be re-registered, and confirm that certificates renew on the new ingress or load balancer.

Argo CD and Flux are the usual GitOps tools once a platform runs on Kubernetes. Both are Apache-2.0 licensed and designed for Kubernetes, which means they only apply once Gitea itself runs as a workload on a cluster. They reconcile manifests from Git into a cluster, but they do not move Gitea, restore its database or manage an instance on a VM. A team that starts on a Docker host or VM and plans to move to a cluster later should not assume its deployment pipeline carries over, and a team moving back from Kubernetes to a VM loses that GitOps layer entirely. Ask whether the deployment definitions are kept in a form that can be reapplied on either target, such as Compose files, Helm values or Ansible roles, and who owns each of them. The Argo CD documentation explains what the controller manages once it is in place.

Before committing to either model, ask for a written handover plan that covers the move in both directions. It should name the database dump and restore steps, the Gitea version on each side and the check that they match, the storage paths for repositories, LFS and attachments, and the cutover order for DNS, ROOT_URL and SSH. It should also include an inventory of webhooks and external callbacks with their owners, the runner re-registration steps, certificate issuance and renewal on the target platform, and a rollback path that keeps the old instance readable until the new one passes its checks. Ask who performs each step, what is tested on a staging copy, and which work is one-time implementation and which recurs as operation or retainer support, because the cost of a later move depends on how much was documented at the start. Ask the implementation partner to confirm each item against your own environment.

How much effort and time does each Gitea model take to run?

Which deployment model is cheapest to run for Gitea?

No model is cheapest in every case, because the cost follows the platform team's existing skills and tooling more than the Gitea binary itself. Gitea is MIT licensed, so the software line item is zero, and the recurring costs are the hosts, storage, database, backups, and the staff hours spent on upgrades and monitoring. A single VM is often the smallest footprint to operate for one team, while Kubernetes adds cluster overhead that pays off mainly if the organization already runs clusters. Ask each vendor or partner to price the same scope: hosts, database, backup target, monitoring, and the upgrade calendar.

What drives Gitea running costs up or down over time?

Three things move the bill most: the number of users and repositories, the CI/CD load, and the package registries you enable. Gitea Actions is designed to be compatible with GitHub Actions, so the runner capacity you host becomes a sizing question. Storage grows with repositories and with the more than 20 package registry types, including container images and Helm charts, which makes backup volume and retention a recurring cost. Choosing PostgreSQL or MySQL over SQLite changes the database operations you pay for. Ask for the sizing assumptions in writing so the quote can be rerun when usage grows.

How long does a Gitea deployment take to finish?

Timing depends on the scope agreed in writing, the number of integrations, and how much of the environment already exists. The fastest path is usually a single-host install on existing virtualization, since there are fewer layers to build. Kubernetes deployments usually take longer when the cluster, ingress, storage classes and database operator are not yet in place. Migration from another Git host adds time for mapping repositories, users and permissions. Ask the partner for a phased plan with milestones for environment readiness, installation, SSO, a backup restore test and cutover, and confirm which milestones are yours.

Can our team run Gitea without an outside partner?

Often yes, if the team already runs the chosen platform and has a named owner for upgrades, backups and access control. Gitea is a Go service backed by a database, so a team with Linux and database administration skills can install and patch it by following the official documentation. The gaps usually appear in less visible work: restore testing, SSO and two-factor setup, audit evidence, and upgrade planning across release lines such as v1.27 and v28. Gitea Enterprise adds SAML 2.0, audit logging and IP allowlisting, but it is sold by CommitGo, so confirm its terms directly. Decide which tasks you will own, then ask a partner to price only the gaps.

What skills do we need for a highly available Gitea setup?

High availability needs database and infrastructure skills beyond Gitea itself, because availability depends on the database layer and shared storage. Your team needs PostgreSQL replication and failover experience, plus load balancer health checks and tested failover runbooks. On VMs, Patroni is an MIT-licensed option that runs PostgreSQL in high availability with a distributed configuration store such as etcd or Consul. On Kubernetes, CloudNativePG is an Apache-2.0 operator that uses the Kubernetes API server for failover without external tools. Confirm which components Gitea's documentation requires to be shared for your chosen layout before you size the team or the quote.

What do we need to provide before a partner starts?

The partner needs access and decisions, and those inputs decide whether the scope can be fixed in writing. Expect to provide cloud or hypervisor accounts, network and DNS plans, identity provider details for SSO, backup targets and retention rules, and named owners who approve changes. For Kubernetes, you also provide the cluster and its storage classes, while for VMs you provide the hosts and their sizing targets. Compliance evidence needs its own input, such as which controls your assessor expects and where logs must be kept. DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted platforms in your own infrastructure. It prepares controls and evidence for assessments but does not issue audit reports, and most engagements are fixed-scope and agreed in writing before work starts.

What should a Gitea implementation quote include before we compare?

A useful quote separates one-time work from recurring work and ties both to the written scope. One-time items include environment build, installation, SSO and access setup, migration, hardening, backup restore testing and documentation. Recurring items include upgrades, patch windows, backup monitoring, support hours and any continuous testing retainer. Ask which hosts, databases and licenses are included and which remain your own costs, such as cloud resources, storage and any Gitea Enterprise terms from CommitGo. Also ask how scope changes are priced. DeployOpen does not publish a price list, so the written scope is the basis for comparing offers.

How DeployOpen scopes and runs a Gitea deployment in your infrastructure

DeployOpen plans, implements, hardens, backs up, upgrades, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For Gitea on Docker, Kubernetes or VMs, we match the target to your sizing, availability and upgrade needs, then put the scope in writing before work starts.

How we scope

  • A written scope sets which Gitea target you use: Docker, Kubernetes or virtual machines, and why.
  • Scope records the database engine (MySQL, PostgreSQL, SQLite or MSSQL) and the sizing inputs behind it.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any work starts.

How we build

  • Build the chosen target inside your cloud account, data center or air-gapped network, with your identity provider wired in.
  • Set up backups of repositories and database, and document the restore procedure.
  • Harden the host, container or VM layer and the Gitea settings, then document each control for your reviewers.

How we hand over

  • Handover includes runbooks for upgrades, backup and restore, and day-to-day operation of the chosen target.
  • Your team receives architecture notes, configuration records and the evidence your compliance reviewers ask for.
  • Hardening findings are listed with fixes, and open items are named in writing before the engagement ends.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Upgrade work starts from the Gitea release line you run, such as v1.27 or the v28.x releases.
  • Ask for the support window and upgrade cadence in writing before you pick a target.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.