Forgejo on Docker vs Kubernetes vs VMs

Forgejo on Kubernetes, Docker or VMs: the right model depends on the skills your team already has, how much availability you need and who owns the host and database. This page compares the three on architecture, upgrades, backups and effort.

On this page

Forgejo on Kubernetes vs VMs: which model fits your team

A single Docker host fits a small team that accepts a longer recovery after a host failure, Kubernetes fits a team already running a cluster with GitOps and a PostgreSQL operator, and VMs fit a team that already runs a hypervisor and wants host-level control. For a team that must run Forgejo with SSO and backups, the choice turns on existing skills and availability targets more than on the platform itself. Docker suits a team with no cluster operators, but you own the container volume, the database backup, the SSO connection and a rebuild on replacement hardware after a host failure. Before committing, confirm which install methods Forgejo documents for production, because that list determines whether a Docker or cluster layout is supported without workarounds.

Kubernetes makes sense when the platform team already runs clusters and wants Forgejo managed like its other workloads. Keep the manifests in Git and let GitOps reconciliation apply them with Argo CD or Flux. Both are Apache-2.0, and Argo CD integrates SSO over OIDC, OAuth2, LDAP and SAML 2.0 with RBAC, while Flux uses Kubernetes RBAC with impersonation for multi-tenancy. For the database, a PostgreSQL operator such as CloudNativePG manages persistent volume claims directly and uses the Kubernetes API server for failover without external tools, so you do not run a separate distributed configuration store. Before you commit, check that your team can debug a stuck pod, a failed volume attachment and a failed failover, since those failure modes do not exist on a single host. Confirm the Forgejo install method and the storage class your backups depend on.

VMs fit a team that already runs a hypervisor and wants host-level control over patching, snapshots and placement. If that hypervisor is Proxmox VE or XCP-ng, the operating effort stays with the platform team you already have, and Forgejo runs in one guest with its own operating system. Snapshots help you roll back before an upgrade, but a snapshot of a running database is not a tested backup, so keep application-level dumps or a consistent backup of the database and repositories. Ask who patches the hypervisor, who owns the restore runbook and which support window applies: XCP-ng 8.3 LTS is supported until November 30, 2028, while XCP-ng 8.2 LTS support ended on September 16, 2025. Forgejo v15 is the LTS release supported until July 15, 2027, so align your guest upgrade plan with that date.

How Forgejo on Docker, Kubernetes and VMs compare on the factors that matter

This table compares how Forgejo fits on Docker, Kubernetes and virtual machines across host ownership, high availability, upgrades, backups, identity, networking and skills. Read each row as a question your team must answer, because the supplied material does not settle every setup detail. Where a cell says to confirm, check Forgejo's admin documentation or your own environment before you commit to a design.

FactorDockerKubernetesVMs
Best fitSmall teams running Forgejo on one host and comfortable managing containers and volumes directly.Platform teams already running a cluster that want Forgejo managed like their other workloads.Teams that manage Linux servers directly and want Forgejo installed on a host they control.
Who owns the hostYour team owns the Docker host, its OS patching and the container runtime.The platform team usually owns the cluster. Confirm who owns Forgejo config and upgrades in writing.Your team owns the VM, its OS, patching and the Forgejo service end to end.
High availability approachA single container per host. Multi-host failover needs extra tooling you select and test. Confirm supported multi-instance setups in Forgejo's admin docs.The scheduler restarts and replaces pods, but shared storage and database design decide whether replicas are safe. Confirm this with Forgejo's docs.Failover comes from your hypervisor or host clustering, which you design and test. Confirm which multi-instance setups Forgejo supports.
Upgrade mechanicsPull a new image tag, review migration notes in the upgrade guide, then restart the container.Roll out a new image through your manifests or chart after checking migration steps and config changes.Replace the binary or package and restart the service, with a backup taken before each step.
Backup scopeRepository data, the database, and the volumes or bind mounts holding config. Confirm exact paths in the admin docs.Database, persistent volumes, secrets and config maps, plus manifests kept in Git. Test restores inside the cluster.Database, data directory, app config and any host configuration needed to rebuild the server. Confirm data directories in the admin docs.
Identity and network setupReverse proxy and TLS usually sit outside the container. SSO settings live in Forgejo config. Confirm supported SSO options.Ingress, TLS and network policies are cluster objects. SSO settings still live in Forgejo config. Confirm options in the admin docs.Host firewall, reverse proxy and TLS are configured on the VM. SSO settings live in Forgejo config. Confirm supported options.
Operating skills neededLinux basics, container images and volumes, and Compose or similar tooling for repeatable deploys.Cluster operations, storage classes, ingress and Kubernetes RBAC, alongside Forgejo administration.Linux administration, service management, patching and backup scripting.
Licensing contextForgejo is GPL-3.0-or-later from v9.0, with earlier versions under MIT. Confirm terms for any sidecar images you add.Forgejo is GPL-3.0-or-later from v9.0, with earlier versions under MIT. Confirm terms for any operator or chart you adopt.Forgejo is GPL-3.0-or-later from v9.0, with earlier versions under MIT. Confirm terms for any host packages or tooling you add.

Forgejo deployment options: the components each model adds

Each model adds its own layers around the same Forgejo application. The cards below list what your team would own under Docker, Kubernetes or VMs, and the checks to run before you compare effort and cost. Several layers, such as database failover and runners, apply under every model, but the tooling and the team that operates it change.

Forgejo application and repository data

The Forgejo process serves the web interface, Git over HTTP and SSH, and the API. Its state lives in two places: repository data on a filesystem path you configure, and metadata in the database. Docker typically mounts that path as a volume, Kubernetes binds it to a persistent volume claim, and a VM keeps it on the guest disk. Back up repository data and the database together, then test the restore on your own infrastructure before go-live. Confirm which release line you will run, since v15 is the LTS release supported until July 15, 2027.

Forgejo releases

Database and high availability layer

Forgejo keeps its metadata in a relational database, and your model decides who runs its failover. On VMs, Patroni (MIT) runs PostgreSQL 9.3 to 18 in high availability, with ZooKeeper, etcd, Consul or Kubernetes as the distributed configuration store. On Kubernetes, CloudNativePG (Apache-2.0, CNCF Sandbox) manages PostgreSQL directly through persistent volume claims and fails over through the Kubernetes API server without external tools. Confirm in the Forgejo admin documentation which database engines Forgejo supports before you choose either layer.

Shared storage for repository data

If more than one Forgejo instance serves the same repositories, you need a shared storage layer, and that layer becomes its own failure domain. Most of Ceph is dual licensed under LGPL 2.1 or 3.0, and it provides block, file and object storage on one RADOS cluster, so one cluster may serve several components. Check release dates first: Ceph Squid (v19) reached its estimated end of life on October 31, 2026, and Ceph Tentacle (v20) is estimated to end on June 1, 2027. Confirm with Forgejo that your multi-instance layout and storage type are supported before you commit.

Forgejo Actions runners as separate processes

Forgejo Actions is built in, but workflows run on separate runners, so each runner is another process you deploy, patch and scale. Forgejo Actions is designed to feel familiar to GitHub Actions users, but it is not compatible with GitHub Actions, so copied workflows need review. Decide where runners execute, which networks and secrets they can reach, and whether they share a host with Forgejo. Confirm the runner deployment method for your model in the Forgejo documentation before you open CI to pull requests.

Forgejo Actions overview

GitOps layer on Kubernetes

On Kubernetes, a GitOps controller applies Forgejo and cluster manifests from Git. Your two options are Argo CD and Flux, both Apache-2.0. Argo CD adds a web UI, multi-cluster management and SSO over OIDC, OAuth2, LDAP or SAML 2.0 with RBAC. Flux uses Kubernetes RBAC with impersonation for multi-tenancy and supports Helm, Kustomize and OCI artifacts. Check which identity and tenancy model your platform team already runs before you choose one.

Argo CD documentation

Host layer on virtual machines

On VMs, the hypervisor is a component you must patch, back up and upgrade alongside Forgejo. Proxmox VE combines KVM and LXC with Ceph and ZFS storage, and its code is licensed under AGPL-3.0. Its subscriptions are priced per CPU socket and differ only in support level. XCP-ng is Xen-based, managed through Xen Orchestra, and its 8.3 LTS release is supported until November 30, 2028. Confirm the support terms and update path for the host you choose, because Forgejo upgrades do not replace host maintenance.

XCP-ng releases

How Forgejo's support windows set your upgrade rhythm

Forgejo's support windows set your upgrade deadline, so choose an upgrade rhythm before you choose an install method. Stable releases get full support for three months plus a two-week window. Forgejo v17.0.0, released October 15, 2026, is supported until January 28, 2027, so a stable install on that line has a short window before support ends. The LTS track trades cadence for length: releases published in the first quarter of a year get critical bugfixes and security support for one year and three months, and v15 is supported until July 15, 2027. Check the current entries on the Forgejo releases page before you set a calendar, since those dates are the ones your plan has to match.

Each install model turns that clock into its own change process and tested runbook. On Docker, an upgrade is an image tag change followed by a pull and restart, so the runbook covers the backup taken beforehand, the release notes for the target tag and the previous image kept for rollback. On Kubernetes with GitOps, the same change is a commit that Argo CD or Flux reconciles, so the runbook covers pull request review, the order of the Forgejo and database changes, and rollback by reverting the commit. On virtual machines, the upgrade happens in place, so the runbook covers binary or package replacement, service restart, a database backup and a restore test. In every case, the time from a new stable release to a tested production upgrade must fit inside the window you are running on.

If you are moving from Gitea, Forgejo documents transparent upgrades from Gitea up to Gitea v1.22 in two steps, first to Forgejo v10.0.x and then to any later Forgejo version. Treat that path as a one-time note for migration planning, and confirm the exact steps for your install method in the Forgejo upgrade guide before you schedule anything. Whoever writes the runbook should test it against the version you will run, using a copy of production data, and record how long the restore took, so the rhythm you choose is one your team can keep.

Decision path: from team skills to a Forgejo deployment model

The path starts from the platform your team already runs: a single Linux host or hypervisor, or a Kubernetes cluster that already uses GitOps. A single host or hypervisor leads to a recovery target check. If restoring from backup meets that target, Forgejo on Docker is the simpler fit. If automatic failover is required, the next question is whether your team can own a database HA layer. A yes leads to Forgejo on VMs with Patroni. A no, or an existing GitOps cluster, leads to Forgejo on Kubernetes with Argo CD or Flux and CloudNativePG. Before you choose, confirm your recovery time and data loss targets in writing, and confirm who will be on call for the database.

Decision path from the current platform to one of three Forgejo deployment models.

Why Forgejo high availability depends on the database layer

Forgejo availability is decided by three things: the Git data on disk, the database that holds repository and account metadata, and the shared storage that every application instance must reach. Adding more containers or VMs does not help if they all depend on one database or one volume. The database layer often sets the ceiling for uptime, so design it first and place the application tier on top of it. Before you choose between Docker, Kubernetes or VMs, ask the Forgejo documentation which multi-instance settings it supports, which database engines it lists for that setup, and what it expects from shared storage for repositories and attachments. Those answers constrain the platform choice more than the platform does.

The two failover designs in this comparison differ in where leader election lives. Patroni runs PostgreSQL 9.3 to 18 in high availability and uses a distributed configuration store, which can be ZooKeeper, etcd, Consul or Kubernetes, to agree on which node is the leader. That store becomes a dependency of the database, so it needs its own quorum, backups and monitoring. The Patroni documentation explains each store option. CloudNativePG is a Kubernetes operator that manages PersistentVolumeClaims directly and uses the Kubernetes API server for failover, so it needs no external failover tools. That reduces moving parts only if your team already operates Kubernetes well, and the operator still needs a tested runbook for its failure modes.

Neither mechanism makes Forgejo highly available on its own. The Forgejo side of multi-instance operation, including whether and how several Forgejo instances can share one database and one storage backend, must be confirmed in Forgejo's documentation for the version you plan to run, and the answer should be in writing before the architecture is fixed. Then test every failover path in your own environment before go-live. Stop the primary database node, the Kubernetes node or the VM hosting it, and check that Git clone, push, web login and CI jobs recover and that the new leader accepts writes. Record how long recovery takes and what users see during it. Repeat the test after each upgrade, because a failover that worked on one version may behave differently on the next.

Upgrades, backups and monitoring for Forgejo on each model

This table compares how the three deployment models change day-to-day operation of a self-hosted Forgejo instance: upgrades, backups, monitoring, logging, host patching, skills and ownership. Read each row across the columns to see where the operating work lands. The main takeaway is that the Forgejo upgrade path is the same on every model, so the difference lies in the layer underneath it, and that layer decides how much work your team carries.

FactorDockerKubernetesVMs
UpgradesChange the image tag, keep the previous image for rollback, then restart. Follow the stable or LTS track; LTS gets one year and three months of critical and security fixes.Roll out a new chart or manifest version through your pipeline, with a rollback path. Follow the stable or LTS track and confirm the order of any migration step.Install the new Forgejo binary or package on a staging copy, then replace production in a planned window. Rollback means restoring the previous binary and data.
BackupsBack up data volumes, repositories and any database, including external ones. Confirm backup scope and restore testing for your setup.Back up persistent volumes, the database and the cluster configuration. Confirm backup scope and restore testing for each cluster and namespace.Back up the data directory and database, or snapshot at the hypervisor level. Confirm backup scope, snapshot consistency and restore testing.
Monitoring and alertingOne option: Prometheus (Apache-2.0) pulls metrics over HTTP, is queried with PromQL, and sends alerts to Alertmanager. Confirm Forgejo's metrics endpoint.The same Prometheus option applies, with scrape targets found through Kubernetes service discovery. Confirm pod restart and volume alerts are covered.Prometheus can scrape the Forgejo endpoint, but host metrics need an exporter on each VM. Confirm which alerts each VM must raise.
LoggingContainer logs use the Docker log driver by default. Ship them to a central store and confirm rotation and retention settings.Pods can restart or move, so logs need cluster-level collection. Confirm where logs land and how long they are kept.Logs stay in the host's journal or files unless forwarded. Configure rotation, forwarding and retention on every VM.
Host patchingPatch the Docker host OS and container runtime, restarting containers in a maintenance window. Single-host setups have no spare capacity during patching.Patch nodes one at a time with cordon and drain, plus control plane updates. Confirm the cluster version and node OS policy.Patch the guest OS and any hypervisor layer under it, planned per VM. Confirm how the hypervisor handles live migration before patching.
Skills the operating team needsLinux administration, container image handling and reverse proxy setup. The smallest skill set of the three models.Kubernetes operations, Helm or manifests, storage classes, RBAC and network policy. The largest skill set of the three models.Linux administration, hypervisor management, and network and storage configuration. Familiar to many infrastructure teams.
Client owns versus DeployOpen retainerClient owns hosts, images and backups. A retainer can cover upgrades, patch cadence and monitoring tuning if the scope is agreed in writing.Client owns the cluster, nodes and backups. A retainer can cover upgrades, cluster maintenance and monitoring tuning if agreed in writing.Client owns the hypervisor, VMs and backups. A retainer can cover upgrades, patch cadence and monitoring tuning if agreed in writing.

What drives the cost of running Forgejo on each model

The biggest cost difference between the three models is usually who does the work, since Forgejo is GPL-3.0-or-later and carries no license fee on any of them. Three parties get paid. Your staff time is typically the largest line and covers design, the first deployment, hardening and then every upgrade and backup test. Your cloud or hardware capacity is the second line, and it grows with the number of runners, storage volumes and replicas each model needs. If you use DeployOpen, the fee is a fixed-scope implementation charge agreed in writing before work starts, and ongoing support, upgrades and continuous testing can be added as a retainer. One-time costs include design, implementation, migration and hardening. Recurring costs include patching, upgrades, backups, monitoring and on-call, and they run for as long as the forge does.

Licensing only enters the picture on the VM path, and only if you add a commercial hypervisor layer. Proxmox VE subscriptions are priced per CPU socket, include the Enterprise Repository and differ only in support level, so the decision in a quote is the support response you need. Count the sockets on every host in the cluster, because each added host adds a subscription line. If your VM platform is XCP-ng, the 8.3 LTS release is supported until November 30, 2028, so plan the next upgrade against that date. Kubernetes itself carries no license line under Apache-2.0, but a managed service, a vendor support contract or a commercial distribution may add one, so confirm each with its provider. On the Docker path, confirm any subscription terms for the container runtime and host OS. Ask the quote to state whether it includes hypervisor or cluster subscriptions or assumes you already hold them.

DeployOpen does not publish a price list. A quote follows from the written scope, so the scope is where cost is controlled. Ask for the chosen model and the reason for it, the list of hosts, VMs, runners and storage that model needs, and which one-time items are included, such as design, implementation, migration and hardening. Then ask which recurring items are covered and for how long, including patching, upgrades, backups, restore tests, monitoring and on-call hours. Check who holds each subscription, what a retainer covers and what triggers extra work. Finally, ask what a later move between models would involve for the same setup. Also estimate your own staff hours for the recurring items, since that is the line most often left out of the first comparison.

Forgejo on Docker, Kubernetes or VMs: which team each model suits

This model suits a small team with one Linux host, no cluster and no hypervisor to lean on. Forgejo runs as a single service on that host with its repositories and database on local storage, which keeps the number of moving parts low. The cost of that simplicity is that one host is one failure domain, so backups and restore tests carry most of the availability weight.

  • Fits: one Forgejo instance behind a reverse proxy, a modest number of repositories and users, and a team that can schedule upgrades in a maintenance window.
  • Avoid: calling one host high availability, or running CI jobs on the forge host without deciding how their resource use is isolated.
  • Own after go-live: OS patches, TLS certificates, Forgejo upgrades, scheduled backups of repository and database data, and a restore runbook that someone has rehearsed. Forgejo v15 is the LTS release, supported until July 15, 2027, so plan the next major upgrade against that date.
  • Stops making sense when: a maintenance window no longer meets your uptime needs, or when automated failover or a second site becomes a requirement.

Confirm your recovery time target with the business owners, and read the Forgejo upgrade guide before you choose a release.

Forgejo deployment options: questions buyers ask before hiring help

How much effort does running Forgejo on Kubernetes take?

The effort depends mainly on whether your team already operates Kubernetes clusters, because the cluster is extra work on top of Forgejo. The Forgejo part is a stateful service with a database, persistent volumes for repository data, ingress for HTTPS and SSH Git access, and backups that cover both the data and the configuration. Effort rises when the cluster is new to the team, when storage classes need testing, or when SSH traffic must pass through a load balancer. Effort falls when a platform team already runs upgrade, monitoring and backup tooling for stateful workloads. Ask for the written scope to list which cluster tasks are included and which stay with your team. Confirm the deployment method and supported configuration for your target Forgejo version in the Forgejo documentation before you compare quotes.

Can our team run Forgejo on Docker or VMs without outside help?

Often yes, if your team already runs Linux servers, containers or hypervisors and has a named owner for upgrades and backups. Forgejo runs as one application backed by a database and file storage, so a single Docker host or VM is a smaller footprint than a cluster. Gaps usually appear in four places: database setup and tuning, TLS and reverse proxy configuration, SSO integration, and a tested restore. Team size matters less than whether someone has time to own the system after go-live. Forgejo's release policy adds a recurring task: stable releases get full support for three months plus a two-week window, while LTS releases, published in the first quarter of each year, get one year and three months of critical fixes and security support. Plan upgrades on that cycle and read the Forgejo upgrade guide before deciding.

How long does a Forgejo deployment take to complete?

The supplied material does not give a deployment duration, so timelines follow the written scope. The main drivers are the number of environments (test, staging and production), whether the hosting platform already exists, the integration points such as SSO, backup targets and CI runners, the number of repositories to migrate, and whether a security review runs before go-live. DeployOpen delivers most engagements as fixed-scope work, with scope, deliverables and timelines agreed in writing before work starts. Ask for a schedule with milestones for infrastructure readiness, installation, integration, a restore test, handover and any retest. Ask which items depend on your own teams, such as change approvals, cloud account access or identity provider configuration, because those often set the pace.

What does a Forgejo deployment need from our internal team?

The client team supplies access, decisions and long-term ownership. Confirm these items in the written scope:

  • Hosting: cloud or data center accounts, network segments, hypervisor or cluster access, and the approved operating system or image baseline.
  • Identity: an SSO contact and the group mapping for administrators and regular users.
  • Data: decisions on backup targets, retention periods and who owns the restore test.
  • Network: DNS names, TLS certificates, and firewall rules for HTTPS and Git over SSH.
  • Operations: a named owner for upgrades, monitoring alerts and on-call routing after handover.

Also confirm who approves access requests and production changes, since those approvals often decide the schedule more than the technical work does.

Is Docker acceptable for a production Forgejo deployment?

Yes, Docker can run production Forgejo workloads when the surrounding controls are in place, but the container is the simplest part. Acceptability depends on how the team handles persistent volumes, pinning the image to a tested version, secrets, host patching, log collection and restores. A single container on a well-managed host with tested backups can meet many teams' needs, while several instances usually need a load balancer and a shared database, which pushes the design toward an orchestration layer. Confirm with your security and compliance teams how container images are sourced and approved, who receives vulnerability alerts for the base image, and how the host is hardened. Ask the implementer to demonstrate a restore onto a clean host, because a backup that has never been restored does not show that recovery works.

Do we need a Kubernetes cluster for Forgejo high availability?

No, a Kubernetes cluster is not required for high availability, but high availability needs several conditions at once: more than one Forgejo instance, a database with its own failover, repository storage that every instance can reach, and a load balancer or virtual IP that moves traffic away from a failed node. These pieces can be built on VMs with a load balancer and a clustered database, or on Kubernetes with its scheduling and health checks. The better choice depends on what your team already operates well. Confirm with the Forgejo documentation for your target version which multi-instance layouts it supports and how it behaves across nodes. Then agree in writing on the recovery target and a failover test, because the platform does not supply an uptime figure on its own.

What drives the cost of a Forgejo deployment engagement?

The engagement has two cost parts: one-time work to plan, install, integrate, test and hand over, and recurring work for upgrades, monitoring and support. The one-time part grows with the number of environments, integrations, repositories to migrate and depth of security testing. The recurring part depends on whether your team absorbs upgrades itself or buys a retainer for them. Forgejo is licensed under GPL-3.0-or-later from v9.0 onward, so the software license does not add a fee, but hosting, storage and staff time do. DeployOpen does not publish a price list, and a quote follows from the written scope. Ask for the quote split into one-time and recurring items, with the responsibilities for each, the exclusions, and the rate for changes made after the scope is agreed.

How DeployOpen scopes and runs a Forgejo deployment

DeployOpen starts Forgejo on Docker, Kubernetes or virtual machines from your hosting model, identity setup, backup targets and upgrade window. Engagements are fixed-scope, with deliverables agreed in writing before work starts. The same method applies to each runtime, so the runtime decision stays with your team.

How we scope

  • The written scope names the runtime you choose: Docker, Kubernetes or VMs, with the reasons behind it.
  • Sizing covers CPU, memory, storage and repository growth, using load figures your team provides.
  • Scope also records identity, backup targets, upgrade windows and whether you run an LTS line or stable releases.

How we build

  • Forgejo is installed inside your own cloud accounts, data centers or air-gapped network.
  • Database high availability, where your design needs it, is scoped separately for VMs or Kubernetes.
  • Workflows copied from GitHub Actions need review, since Forgejo Actions is familiar but not compatible.

How we hand over

  • Handover documentation covers the runtime you chose, with install, configuration and recovery steps for your team.
  • Backup configuration and restore steps are documented so your team can run recovery without us.
  • Compliance evidence, such as configuration records and access settings, is prepared for independent auditors, who issue any attestation.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, agreed separately from the build.
  • Forgejo stable releases get full support for three months plus a two-week window, so upgrade cadence belongs in scope.
  • Forgejo v15 is the LTS release supported until July 15, 2027, so confirm which line your scope targets.

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.