Databases14 min read•Updated November 2026

AMD EPYC VPS for PostgreSQL Workloads

Quick answer

For production PostgreSQL on an AMD EPYC VPS, install a supported major version from the official PostgreSQL (PGDG) repository, keep it listening only on localhost or a private interface with SCRAM password authentication and TLS for remote clients, and size shared_buffers and connections to the plan. Protect data with base backups plus WAL archiving (for example with pgBackRest) for point-in-time recovery, add a streaming replica for faster recovery, pool connections with PgBouncer, and monitor with pg_stat_statements. Plan major-version upgrades with pg_upgrade or logical replication.

PostgreSQL is a robust default for most applications: strong consistency, rich SQL, JSON support and a large extension ecosystem. Running it well in production is mostly about operations: access control, backups you can restore to any point in time, replication, connection management and upgrades. This guide covers those; for configuration tuning, see our MySQL and PostgreSQL tuning guide.

Install from the Official Repository

Distribution packages lag behind; the PostgreSQL Global Development Group (PGDG) repository provides every supported major version for Ubuntu and Debian:

sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt install -y postgresql-17
sudo -u postgres psql -c "SELECT version();"

Choose a major version that is still supported (each is supported for five years) and that your application and extensions support.

Secure Access

  • listen_addresses = 'localhost' when the app runs on the same server; otherwise the private IP only.
  • password_encryption = scram-sha-256 and scram-sha-256 entries in pg_hba.conf, never trust for network connections.
  • Allow port 5432 in the firewall only from application servers.
  • Enable TLS (ssl = on with certificates) for connections over any network you do not control, and use hostssl lines in pg_hba.conf.
  • Create one role per application with only the privileges it needs; do not use the postgres superuser in applications.
CREATE ROLE app LOGIN PASSWORD 'long-random-password';
CREATE DATABASE app OWNER app;
# pg_hba.conf
hostssl app app 10.0.0.11/32 scram-sha-256

Size Memory and Connections

SettingStarting point (dedicated 32 GB server)
shared_buffers8GB (about 25% of RAM)
effective_cache_size22GB
work_mem16–32MB (per operation, per connection)
maintenance_work_mem1GB
max_connections100–200, with pooling in front
random_page_cost1.1 on NVMe

Backups with Point-in-Time Recovery

Nightly pg_dump is simple and portable but can lose up to a day of data. Production systems should combine periodic base backups with continuous WAL archiving, which allows restoring to any moment, for example just before an accidental DELETE. pgBackRest (or Barman, or WAL-G) automates this:

# postgresql.conf
archive_mode = on
archive_command = 'pgbackrest --stanza=main archive-push %p'
wal_level = replica

# full backup weekly, incremental daily (cron or systemd timers)
pgbackrest --stanza=main --type=full backup
pgbackrest --stanza=main --type=incr backup

Store the repository off the database server (object storage or another server), encrypt it, keep several full backups, and regularly restore to a test server to prove it works. Keep a logical pg_dump as well for portability.

Streaming Replication

A standby server receiving WAL in real time shortens recovery from a server failure from hours (restore from backup) to minutes (promote the standby):

# on the primary
CREATE ROLE replicator REPLICATION LOGIN PASSWORD '...';
# pg_hba.conf: hostssl replication replicator STANDBY_IP/32 scram-sha-256

# on the standby (empty data directory)
pg_basebackup -h PRIMARY_IP -U replicator -D /var/lib/postgresql/17/main -R -X stream -P

-R writes the standby configuration. Monitor replication lag (pg_stat_replication on the primary), and rehearse promotion with pg_ctl promote or SELECT pg_promote();. A replica is not a backup: mistakes replicate instantly, so keep PITR backups too. Tools such as Patroni automate failover for teams that need it.

Connection Pooling with PgBouncer

PostgreSQL uses a process per connection, so hundreds of idle connections waste memory. PgBouncer in transaction pooling mode lets many application connections share a small number of server connections:

# /etc/pgbouncer/pgbouncer.ini
[databases]
app = host=127.0.0.1 port=5432 dbname=app
[pgbouncer]
listen_addr = 127.0.0.1
listen_port = 6432
auth_type = scram-sha-256
pool_mode = transaction
max_client_conn = 1000
default_pool_size = 30

Transaction pooling is incompatible with session-level features such as session advisory locks and some prepared-statement usage; check your driver's documentation.

Useful Extensions

  • pg_stat_statements: query statistics; essential for performance work.
  • pgcrypto and uuid-ossp (or built-in gen_random_uuid()): cryptography and UUIDs.
  • pg_trgm: fast fuzzy text search with trigram indexes.
  • PostGIS: geospatial data.
  • pgvector: vector similarity search for embeddings.

Routine Maintenance

  • Keep autovacuum on and check it keeps up on large, busy tables (pg_stat_user_tables).
  • Watch table and index bloat; REINDEX CONCURRENTLY rebuilds bloated indexes without blocking writes.
  • Apply minor version updates promptly; they are bug and security fixes and need only a restart.
  • Review slow queries weekly with pg_stat_statements.

Major Version Upgrades

MethodDowntimeNotes
pg_dump / restoreProportional to database sizeSimplest; fine for small databases
pg_upgrade --linkMinutesFast in-place upgrade; take a backup first
Logical replication to a new serverSeconds to minutes at cut-overMost work; best for large, busy databases

Test the upgrade on a copy first and check your extensions are available for the new version.

Monitoring

Track connections, transaction rate, cache hit ratio (pg_stat_database), replication lag, long-running transactions, locks, disk space and WAL archive failures. The Prometheus PostgreSQL exporter and a dashboard cover most of these (see our monitoring guide). Alert on failed archiving: it silently breaks your point-in-time recovery.

Schema Changes Without Downtime

Some ALTER TABLE operations rewrite or lock the whole table. On large, busy tables, prefer changes that PostgreSQL can apply quickly: adding a nullable column or a column with a constant default is fast in modern versions; build indexes with CREATE INDEX CONCURRENTLY; add constraints as NOT VALID and validate them separately. Set a short lock_timeout in migration sessions so a blocked migration fails fast instead of queuing every other query behind it.

Roles and Least Privilege

Separate roles for the application (read and write on its tables), migrations (schema changes), read-only reporting and backups. Grant on schemas rather than individual tables where possible, and set default privileges so new tables inherit the right grants.

Production Checklist

  1. Listening only on localhost or a private interface, SCRAM authentication, TLS for remote clients.
  2. WAL archiving and scheduled base backups stored off the server.
  3. A point-in-time restore rehearsed on a test server.
  4. Streaming replica with lag monitoring, if recovery time matters.
  5. PgBouncer in front of busy applications.

SkyRainCloud Plans for This Workload

PostgreSQL benefits most from RAM and fast storage: a dedicated database on 8 vCores / 32 GB keeps a large working set cached on NVMe-backed storage. Small apps can share 2–4 vCore servers with their database.

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — AMD28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthWebsites, small APIs, bots, staging and VPN serversOrder
VPS 2 — AMD416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,299/monthWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
VPS 3 — AMD832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,499/monthProduction databases, high-traffic sites, multi-container appsOrder
VPS 4 — AMD1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,899/monthLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Frequently Asked Questions

Is a VPS suitable for production PostgreSQL?
Yes, with enough RAM, NVMe storage, secure access, point-in-time backups and ideally a replica. Many production databases run on a dedicated VPS.
Where should I install PostgreSQL from?
The official PGDG repository, which provides every supported major version for Ubuntu and Debian.
What is point-in-time recovery?
Restoring the database to any moment using a base backup plus archived WAL, for example just before an accidental delete. Tools like pgBackRest automate it.
Is a replica a backup?
No. Replicas copy mistakes instantly. Use them for fast failover and keep separate PITR backups.
Why use PgBouncer?
PostgreSQL uses a process per connection; PgBouncer lets many app connections share a few server connections, saving memory.
How do I secure remote connections?
Restrict the port to app server IPs, use SCRAM authentication and hostssl rules with TLS, and give each app its own least-privilege role.
How do I upgrade to a new major version?
Use pg_upgrade for fast in-place upgrades, dump and restore for small databases, or logical replication for minimal downtime. Test on a copy first.
Which extensions are worth installing?
pg_stat_statements for performance, pg_trgm for fuzzy search, PostGIS for geospatial data and pgvector for embeddings, as your app needs.
How much RAM does PostgreSQL need?
Enough to cache the frequently used data and indexes. Set shared_buffers around 25% of RAM on a dedicated server and let the OS cache the rest.
Which EPYC plan suits a PostgreSQL server?
8 vCores / 32 GB is a strong dedicated database starting point; 16 vCores / 64 GB for large working sets.
Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning