Installing PostgreSQL in an air-gapped network

Teams running PostgreSQL where servers cannot reach the internet need a controlled way to move packages, images and minor releases across the gap. This page covers how to plan, install and patch it.

On this page

Why installing PostgreSQL in an air-gapped network needs a plan before the first server

Installing PostgreSQL in an air-gapped network works when you plan the transfer of every artifact before the first server is built. The database itself is not the hard part. The work is mostly bringing verified packages, extensions, container images and documentation across the boundary, then repeating that process for every patch and minor release for as long as the database runs. PostgreSQL is released under the PostgreSQL License, a permissive license similar to the BSD and MIT licenses, so there is no license server to reach at install time. Your constraint is provenance and repeatability, not activation.

Plan around the supported major versions. According to the PostgreSQL versioning policy, versions 14 through 18 are supported, with final release dates of November 12, 2026 for 14, November 11, 2027 for 15, November 9, 2028 for 16, November 8, 2029 for 17 and November 14, 2030 for 18. Choose the major version you will run for the next several years and confirm its end date against the current policy before you build the mirror, because the end date determines when a major upgrade must be funded and scheduled. Minor releases arrive at least every three months, so the transfer process will recur on that cadence, not just once at build time.

Decide early how each artifact gets in and who signs off on it. Typical inputs are the PGDG package repository mirror, extension packages, base images for any container deployment, and the tools used for backup and pooling. Ask your security team which hash or signature check they require before an import, who approves each transfer, and where the approved copies are stored. Confirm with your own team whether your change process treats a minor update as a routine patch or a full change. Settling these questions first keeps the first server build from becoming the first time anyone has tested the transfer path.

Which mirror and transfer approach fits each environment

At a fully disconnected site, nothing crosses the boundary over a live network path, so every operating system package, PostgreSQL package, extension and container image must arrive as a complete, pre-staged set. Build the mirror on a connected staging host and include everything the install and later patching depend on, including dependencies you would otherwise fetch on demand.

  • OS and PGDG repository snapshot: mirror the base operating system repositories and the PostgreSQL repository for each major version you run, along with the signing keys.
  • Extension packages: include every extension package and its shared library dependencies, pinned to the PostgreSQL major version in use.
  • Container images: if PostgreSQL runs in containers, store the image by digest in an internal registry, with the tags your deployment references.
  • Previous and current minor releases: keep both package sets so a rollback stays possible after a minor update.

The staging team verifies signatures on the connected host, and the security team reviews the manifest before anything is released. Confirm with your security owner whether a second approver is required, the media handling rules, how often approved update sets are released, and which accreditation evidence the import must record.

Configuration options and when each fits

This table compares the main ways to get PostgreSQL packages, container images and extensions into a network that cannot reach the internet. Read each row by asking what it carries, which upgrade pattern it supports and how much you will maintain yourself. The main takeaway is that a full local repository mirror is easier to keep current, while per-release snapshots are smaller but must be refreshed deliberately.

OptionWhat it carriesWhen it fitsTrade-off
Full local PGDG mirrorRepository metadata and packages for every PostgreSQL major version and the extensions published in the PGDG repositoriesSeveral major versions run side by side, or teams need routine minor-release patching over a long periodLargest transfer and storage footprint, and the mirror needs its own sync, signing check and retention process
Per-release snapshotOnly the packages for the minor releases and major versions you run, captured at one point in timeA small, fixed fleet on one major version with change windows that are planned weeks aheadSmaller to move across the gap, but every new minor release needs a new import, and gaps appear if a release is skipped
Private registry for the official postgres imageThe postgres container image tags you select, plus any base images your build depends onTeams that run PostgreSQL in containers and deploy through an internal registry or KubernetesImage digests must be recorded and checked, and the image is only as current as the last import you approved
Offline extension packagesExtension packages built for your chosen PostgreSQL major version, with their dependency packagesThe application needs extensions such as PostGIS, pgvector or pgaudit that are not in the base installEach extension ties you to specific major versions, so extension updates must be tested alongside core minor releases
Build-time image and package reviewThe bundle of artifacts, checksums and an import record for each transferYour security or compliance team must review what enters the isolated networkAdds a review step to every transfer, and the reviewers need to confirm the signature and checksum process before the first import
Vendor-supplied media or appliance kitsA packaged set chosen by the vendor or integrator for your environmentYou want a single delivery and do not have a repository tooling teamContents and update cadence depend on the supplier, so ask what is included and how updates arrive

How to set up an offline PostgreSQL install step by step

This sequence takes a chosen PostgreSQL major version from a verified staging mirror to a running, version-confirmed service on a host that cannot reach the internet. Each step closes with a check so the next step starts from known good state.

  1. Choose the major version and minor snapshot

    The platform team, with the application owner, selects the PostgreSQL major version to install and records the minor release that the mirror will carry. Check the supported range in the versioning policy first: PostgreSQL 18 is supported until November 14, 2030, while 14 reaches end of life on November 12, 2026, so a new install on 14 starts with a short remaining window. Write the chosen major version, minor release and target operating system into the change record. Done when the record names one version and one OS family, and the team agrees that the version is supported for the planned life of the system.

  2. Build the staging mirror on a connected host

    On a connected staging host, configure the PGDG repository for the target OS and sync only the packages for the chosen major version, plus the extension packages and dependencies the application needs. If the deployment uses container images, pull the exact tags and save them to an archive. Keep a manifest listing every package name, version and file hash. Done when a local repository metadata check passes on the staging host and the manifest lists the same count of files as the sync reports. Confirm the sync tooling and repository layout against the PGDG documentation for your OS, because the exact commands differ by distribution.

  3. Verify checksums and signatures of every package

    The security team or the staging engineer verifies each package against the signing keys published by the PostgreSQL project before anything crosses the boundary. Import the repository signing key through a channel you trust, compare its fingerprint with the value published by the project, and check every RPM or DEB signature and every archive checksum against the manifest. Store the verification log and the manifest together and sign the bundle with your internal key. Done when every file reports a valid signature or matching hash, and no file is unverified. Obtain the signing key fingerprint from the official project site, not from the mirror itself.

  4. Transfer the bundle across the boundary

    The change owner moves the signed bundle through the approved transfer path, such as a controlled removable media process or a data diode, depending on your network policy. Record the media identifier, the bundle hash and who handled it at each hop. On the isolated side, recompute the hashes of every file and compare them with the manifest before the files are used. Done when the recomputed hashes match the manifest exactly and the transfer record is complete. Any mismatch stops the process and the bundle is rebuilt from staging. Under NERC CIP-013-2, verification of software integrity and authenticity is the control this step supports, so keep the record for audit.

  5. Install from the local repository

    On each air-gapped host, the systems engineer points the package manager at a local repository built from the verified bundle and disables external PGDG and distribution repositories so nothing reaches outside. Install the server package, client tools and approved extension packages for the chosen major version. Disable the distribution's built-in PostgreSQL module where the OS uses one, so it does not override the chosen version. Done when the package manager resolves every dependency from the local source and the install transaction completes without network fetches. Check the package log for any attempt to contact an external host.

  6. Run initdb and set up the service

    The database administrator initializes the data directory with initdb using a dedicated OS account, sets the data directory and any WAL location on the storage chosen for the system, and enables the systemd service for that cluster. Configure the listen address, authentication in pg_hba.conf with SCRAM for password logins, and TLS settings before the first start. Keep configuration files under version control. Done when initdb completes without errors, the data directory permissions are restricted to the service account, and the service unit is enabled but the cluster is not yet exposed to application traffic.

  7. Confirm the service starts and the version matches

    Start the service and check that it stays running, then connect locally and run SELECT version() to confirm the server reports the same major and minor release recorded in the manifest. Review the server log for startup errors and confirm that no outbound connection attempts appear. Record the output in the build record. Done when the service is active after a restart, the reported version matches the mirror snapshot, and the log contains no errors. If the minor release differs from the manifest, stop and rebuild the bundle rather than accepting the mismatch.

How minor releases cross the gap without a storage format change

Minor PostgreSQL releases keep the same on-disk format, so a patch is a file replacement and a restart rather than a data migration. The cards below cover the parts of that cycle that matter in an isolated network: staging the package, checking it before it lands, keeping a way back, and recording what changed.

Plan the transfer to the release cadence

The PostgreSQL project ships minor releases at least once every three months, so an air-gapped estate should expect a recurring patch cycle rather than an occasional event. Build a standing calendar that starts the transfer window shortly after each release is published, then allows time for the import, test and change steps. Ask your team which minor version each cluster runs today and how many releases behind it may fall before a security exception is needed.

Minor release cadence
3 months
Versioning policy

Stage packages on the isolated side

Import the new minor release packages from your mirror into a staging repository inside the enclave, keeping the same package set used by production. Mirror the matching packages for every node, including replicas and backup tools such as pg_basebackup, so no host runs a mismatched binary. Confirm that each cluster's major version stays on its supported line before staging starts, because a minor patch cannot move a cluster across majors.

Verify packages before they cross

Before a package enters the enclave, check its checksum or signature against the value published by the PostgreSQL project and record the result in the transfer log. Repeat the check on the isolated side after the media is copied, since the copy step is where tampering or corruption can enter. This is the control that supply chain requirements such as NERC CIP-013-2 ask for, applied to database packages. Confirm the exact verification method with your package tooling and your own procedure.

CIP-013-2 text

Test the minor release in a lower environment

Install the new binaries on a non-production copy that matches the production major version, extensions and configuration. Start the server, run the application's smoke tests and check that extensions load and replication connects to the primary. Because the storage format is unchanged, the test is about behavior, extension compatibility and restart timing rather than data conversion. Record which extension builds you tested so the production change does not add an untested component.

Keep a rollback path

Keep the previous package versions in the enclave repository and retain the prior binary directory until the new release has run cleanly. A minor release can be reversed by reinstalling the older executables and restarting, which is simpler than a major rollback, but only if the older packages remain available offline. Take a fresh base backup before the change so a restore point exists if a fault appears later. Confirm with your team how long rollback copies are kept and who approves their removal.

Write the change record

Log each minor upgrade with the cluster name, old and new version, package checksums, test results, the window used and the person who approved the restart. Note any extension that was rebuilt or replaced, because it forms part of the installed set even though the storage format did not change. These records give auditors and security reviewers evidence that every patch was checked and approved. Ask your compliance lead which fields their change process already requires so the template matches.

Moving a major upgrade into an isolated network

A major upgrade inside an isolated network is a second project on top of the install, and it starts with choosing the method. PostgreSQL documents three routes: a dump and restore with pg_dumpall, pg_upgrade, or logical replication. The dump route is the simplest to reason about but needs the longest outage. The logical replication route works between different major versions and, according to the PostgreSQL upgrading documentation, allows a major upgrade with only several seconds of downtime. That gap is why most teams with a strict outage window shortlist it, though it adds work: publications and subscriptions must be configured, sequences handled, and schema changes planned. Confirm the exact steps and limits for your source and target versions in the upgrading documentation before you choose.

Whichever method you pick, the upgrade tooling has to cross the gap too. The target server's new binaries, the matching pg_upgrade or client utilities, and any extensions you run must be mirrored from the PGDG repositories and verified like any other package, because the old and new major versions cannot be mixed on one host. Build the upgrade host from the same offline mirror as production, record package hashes in your change record, and rehearse the full procedure on a copy of production data inside the enclave. Treat the rehearsal timings as your own measurements, since the outage you can promise depends on your data volume and hardware.

Start planning this work early, because the choice of method changes what must be mirrored and tested. The PostgreSQL upgrades group in this series covers the decision between pg_upgrade and logical replication in detail, and the offline mirror described above should be sized for the target version you plan to run. Check the supported version calendar before picking a target, since a version that is out of support when your enclave upgrade lands forces a second upgrade soon after.

Security controls for artifacts carried across an isolated boundary

Every package, image, extension and certificate that enters an air-gapped network crosses a boundary your security team has to trust. The cards below cover the controls that connect that transfer to the database: verifying what arrives, limiting who can move it, choosing authentication and TLS that work offline, and logging each import so it can be reviewed later.

Verify integrity and authenticity of every artifact

Check each PostgreSQL package, container image and extension against signatures or checksums published by its source before it enters the enclave. Record the expected digest next to the file, so the verification result can be reproduced on the isolated side without contacting the internet. This is the control NERC CIP-013-2 describes for vendor software and patches: procurement processes must address how you confirm that software is genuine and unaltered. Ask your team which signing keys they trust and who maintains them.

PostgreSQL licence

Control access to transfer media

Treat the USB drive, optical disc or one-way transfer appliance as a controlled asset. Limit who can prepare bundles, who can carry them across the gap, and who can import them on the isolated side. Scan media on a dedicated staging host before mounting it on any database server, and keep a signed manifest of the bundle contents. Confirm with your security team how media is logged, sanitized and destroyed after use.

Use SCRAM for password authentication

Set password_encryption to scram-sha-256 and choose scram-sha-256 in pg_hba.conf for password logins. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so any role still using MD5 hashes should be reset during the build. Confirm that every client library in your offline application stack supports SCRAM before you lock the configuration, because an older driver can block the migration.

Authentication methods

Source TLS certificates offline

Generate the server and client certificates from an internal certificate authority that runs inside the enclave, and load the CA certificate into each host's trust store during the build. Plan certificate lifetimes and rotation in advance, since no public certificate authority or online revocation check is available. Confirm where the private CA key is stored, who can sign requests, and how a compromised certificate would be revoked and distributed to clients.

Log every import and its verification result

Record each import with the bundle identifier, the importing account, the time, the verification outcome and the destination host. Forward these records to a log store inside the enclave so they survive a compromised database server. Keep the log alongside the manifest so an auditor can trace any installed package back to the transfer that carried it. Confirm the retention period with your compliance team before the first import.

Restrict who can approve imports

Separate the roles that prepare a bundle, verify it and install it, so no single administrator can carry an unreviewed artifact into the database tier. Document the approval step in the change record for each minor release. Ask your change advisory board how emergency patches are approved when the normal transfer window is closed.

How artifacts flow from the staging network into the isolated PostgreSQL estate

The flow starts on a staging mirror in a connected network, where PGDG packages, extension packages and container images are copied from their upstream sources. Each artifact then passes a verification step (checksums, signatures and a malware scan recorded in a manifest) before it is placed on approved transfer media or a one-way gateway. Only after that check does the item reach the internal package repository inside the trust boundary, where the isolated PostgreSQL nodes install and patch from it. Confirm each hand-off with your security team, including who approves the crossing and how it is logged.

Artifacts move one way from a verified staging mirror into the isolated estate.

What buyers ask before hiring help with an air-gapped PostgreSQL install

How much effort does an offline PostgreSQL install take, and what drives it?

Effort depends mostly on how many artifacts must cross the gap and how many environments need them. An offline install needs the PostgreSQL server packages from the PGDG repositories, any extension packages you plan to use, OS dependencies, and, if you run containers, the image layers for PostgreSQL and its tooling. Each item must be mirrored, checksummed and transferred through your approved process. The main drivers are the number of major versions you support, the number of extensions, whether you run high availability tooling such as Patroni or a pooler such as PgBouncer, and how many environments (test, staging, production, disaster recovery) must stay in step. Ask a provider to list every artifact in writing before quoting, because the list sets the work. Your own transfer and approval process also adds time that no vendor controls.

Can our team run an air-gapped PostgreSQL install without outside help?

Yes, a team with Linux administration and PostgreSQL experience can do it alone, and many do. The skills that matter most are building a repository mirror, verifying package signatures, managing the transfer process, and writing a runbook for patching across the gap. Teams usually struggle less with the first install than with the second and third, when they must reproduce the same package set, record which versions crossed the boundary, and keep replication and backups working during maintenance. Before deciding, check whether your engineers have done offline package mirroring and cluster failover testing before. A short, scoped review of your mirror design and runbook is a common middle path, and it keeps knowledge in your team.

What does the work need from our team before it starts?

The work needs four things from your side: current network diagrams showing where the isolated segment begins and ends, a named contact who can approve transfers of packages across the boundary, read access to the systems that hold your current build and configuration standards, and agreed change windows for installs, restarts and minor release moves. Many teams also need to confirm which PostgreSQL major versions and extensions are approved, because those choices set the mirror contents. Your security team will likely ask how each package is verified before it enters the network. For NERC-regulated environments, supply chain controls such as CIP-013-2 expect verification of software integrity and authenticity for vendor software and patches, so plan that check into the transfer process from the start.

How long does an air-gapped PostgreSQL install take, and what sets that?

No duration is fixed by the vendor or the project, so ask for a timeline based on your written scope. The schedule is usually set by the approval and transfer cycle across the boundary, not by the database install itself. Other factors include the number of hosts, whether you need a high availability cluster with failover and tested point-in-time recovery, how many extensions must be validated, and whether your change control requires a rehearsal in a non-production environment. Ask for a plan that lists each approval gate, the number of transfer rounds assumed, and the test steps that must pass before production. A fixed-scope quote with those gates in writing makes the timeline easier to compare between providers.

How does our patching cadence affect the ongoing work?

The cadence sets the recurring workload. PostgreSQL releases a new minor version at least once every three months, and minor releases only replace executables and need a restart, since they do not change the storage format. In an air-gapped network, each minor release must be mirrored, verified and carried across the boundary before it can be applied, so a quarterly cycle means a quarterly transfer and change window. Major versions are released about once a year and each is supported for five years. Supported versions currently include 14 through 18, with 14 ending on November 12, 2026, so plan the next major upgrade before that date. Ask any provider whether the retainer covers each transfer, the test run, and the restart window, and whether it covers major upgrades with pg_upgrade or logical replication.

Does DeployOpen issue a compliance certificate for an air-gapped PostgreSQL install?

No. DeployOpen plans, implements, hardens, backs up and documents self-hosted platforms in your infrastructure, and prepares the systems, controls and evidence that a compliance assessment will examine. Independent auditors and certification bodies issue audit reports, attestations and certifications. For an air-gapped build, the evidence usually includes the mirror inventory, package verification records, change records for each transfer, and the configuration baseline. Ask your assessor early which evidence they expect, so the install records it in a usable form from day one.

What should we check in a provider's proposal for an offline install?

Look for a written scope that names every artifact to be mirrored, the PostgreSQL major versions covered, the extensions and tooling included, and the environments that will be built. The proposal should describe how package integrity is verified before transfer, how the mirror is refreshed, and who approves each transfer. It should also state what is delivered, such as a runbook, a restore test and a patch procedure, and what happens after handover. Ask how the provider tests a minor release move before it reaches production, and whether support and upgrades are a separate retainer. A quote that cannot explain these points is hard to compare.

How DeployOpen scopes and delivers an air-gapped PostgreSQL installation

DeployOpen is a Chainscore Labs company that plans, implements, hardens, backs up and documents self-hosted open-source platforms inside the client's own infrastructure, including networks with no internet route. For an air-gapped PostgreSQL installation, that work covers the parts this page describes: building the offline mirror of PGDG packages and extension packages, moving packages and container images across the boundary under your change control, configuring the database servers, and writing the runbook your operators will use for later minor releases. Most engagements are fixed-scope, so the scope, deliverables and timelines are agreed in writing before any work begins. A quote follows from that written scope, not from a standard price list, which DeployOpen does not publish.

The scope document is where the air-gap decisions get made, and it is worth preparing before you ask for a quote. Confirm which major versions you must support and their end-of-life dates under the PostgreSQL versioning policy, which operating systems and architectures the servers run, which extensions are required, and who approves packages entering the enclosure. Name the systems that will consume the mirror, including any Patroni, backup or monitoring tooling, because each adds packages to carry across the gap. Ask the provider to state which items are one-time (initial mirror build, cluster configuration, verification of the first restore) and which recur (minor release cycles, patch intake, retesting after upgrades). DeployOpen prepares systems, controls and evidence for compliance assessments, such as the configuration records, access settings and transfer logs your assessor will request, but it does not issue audit reports, attestations or certifications. Those come from independent auditors or certification bodies, so confirm early which evidence your assessor expects.

Ongoing work is where air-gapped systems most often drift. Each PostgreSQL minor release is a new package set that must be verified, carried in and applied, and the cadence is set by the project's own release policy, not by your maintenance window. DeployOpen offers retainers for ongoing patching, support and continuous testing, so the intake, verification and restart steps for each release can be run by the same people who built the mirror. Ask any provider, including DeployOpen, to define in the agreement who performs each step, how packages are checked before they cross the boundary, what happens when an emergency fix is required, and how the runbook is kept current. Those answers tell you more about the engagement than the headline scope.

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.