[{"data":1,"prerenderedAt":120},["ShallowReactive",2],{"seo-verification":3,"blog-heberger-postgresql-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":21,"featuredImage":23,"bgImage":24,"posterImage":25,"relatedSolution":26,"intro":28,"sections":29,"ctaTitle":75,"ctaBody":76,"ctaButton":77,"ctaUrl":78,"relatedPosts":79},56,"heberger-postgresql-vps","PostgreSQL on a VPS: a reliable and controlled database","Host PostgreSQL on a VPS: volumes, backups, restricted network access and sound configuration for your applications.",8,2240,false,"2026-04-25T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},6,"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[22],{"id":16,"name":17,"slug":18,"color":19,"icon":20},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":18,"appSlug":27},"postgresql","PostgreSQL is often the trusted database of business applications, APIs and analytics tools. On a ServOrbit VPS, you control the version, the storage, the backups and the access instead of paying for a managed database by the GB. The guide focuses on the decisions that matter: persistence, users, network and restoration.",[30,34,44,47,69,72],{"type":31,"title":32,"body":33},"h2","Why self-host PostgreSQL on a VPS","Managed databases (RDS, Cloud SQL) bill per GB stored, per IOPS and per connection, and often limit the available extensions. By deploying PostgreSQL on your own VPS, you enable `pg_stat_statements`, `PostGIS`, `pgvector` or `TimescaleDB` without restriction, you choose your exact version (15, 16, 17) and you keep your data in a jurisdiction you control. A VPS with an NVMe SSD disk and a dedicated CPU offers very low I\u002FO latencies, ideal for the transactional workloads of a production application. You pay a fixed and predictable flat rate, and you alone decide on your strategy for replication, encryption and backup retention.",{"type":35,"title":36,"items":37},"ul","The concrete benefits of a self-hosted PostgreSQL",[38,39,40,41,42,43],"Fixed and predictable cost: no billing per GB, per IOPS or per number of active connections.","Free extensions: `pgvector` for AI, `PostGIS` for geospatial, `TimescaleDB` for time series.","Full control of backups: scheduled `pg_dump`, `pg_basebackup` or physical replication to a second VPS.","Fine tuning of `postgresql.conf` (shared_buffers, work_mem, WAL) impossible with most managed offerings.","Data sovereignty: your data stays on an infrastructure you choose.","Real superuser access to audit, profile and optimize without a support ticket.",{"type":31,"title":45,"body":46},"Hardware and software prerequisites","For a development PostgreSQL instance or a small production project, plan for a VPS with 2 vCPU, 4 GB of RAM and 40 GB of NVMe SSD: PostgreSQL likes memory for its page cache. For a heavier load (several hundred connections or datasets of several tens of GB), aim for 4 vCPU and 8 GB of RAM. On the software side: Ubuntu 22.04 or 24.04 LTS, Docker Engine and the Docker Compose v2 plugin, a domain name pointing to the VPS (e.g. `db.mydomain.com`) if you expose remote access, and a `ufw` firewall configured to let through only the strict minimum. Also reserve a dedicated Docker volume for `PGDATA` to decouple the data from the container.",{"type":48,"title":49,"steps":50},"steps","Deploy PostgreSQL with Docker in production",[51,54,57,60,63,66],{"title":52,"body":53},"Prepare the VPS and the firewall","Connect via SSH, update the system with `apt update && apt upgrade -y`, install Docker via `curl -fsSL https:\u002F\u002Fget.docker.com | sh`. Block port 5432 from the outside with `ufw deny 5432`: the database must never be directly exposed to the Internet.",{"title":55,"body":56},"Write the docker-compose.yml","Create a `postgres:17` service, mount a named volume on `\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata`, and define `POSTGRES_PASSWORD`, `POSTGRES_DB` and `POSTGRES_USER` via a `.env` file that is never committed. Add `shm_size: 256mb` for large sorts and a `healthcheck` with `pg_isready`.",{"title":58,"body":59},"Launch and initialize the database","Start with `docker compose up -d`, check the logs via `docker compose logs -f postgres`, then connect with `docker compose exec postgres psql -U app -d mabase`. Create your application roles with minimal privileges rather than using the superuser.",{"title":61,"body":62},"Expose access via a tunnel or a TLS proxy","For secure remote access, never open 5432 in the clear: use an SSH tunnel (`ssh -L 5432:localhost:5432`) or place `pgbouncer` behind a reverse proxy. Enable SSL on the PostgreSQL side with a Let's Encrypt certificate mounted in the container (`ssl = on` in `postgresql.conf`).",{"title":64,"body":65},"Tune the configuration","Adjust `shared_buffers` to about 25% of the RAM, `effective_cache_size` to 50-75%, and `work_mem` according to your queries. Enable `pg_stat_statements` to identify slow queries. Use the PGTune tool as a starting point.",{"title":67,"body":68},"Automate the backups","Schedule a daily `pg_dump` via a cron task on the host, compress into custom `.dump` format, and copy the archives to external storage. Regularly test restoration with `pg_restore`: an untested backup does not exist.",{"type":70,"body":71},"tip","For high availability, deploy a second VPS in physical streaming replication (`primary_conninfo` + replication slot). You get a warm standby ready to fail over, and you can offload your heavy read queries to it (`hot_standby = on`) to relieve the primary. Combined with `pgBackRest` for differential incremental backups, you reach an RPO of a few minutes without depending on a managed service.",{"type":70,"title":73,"body":74},"The official documentation","For advanced configuration, tool-specific options and version changes, refer to the \u003Ca href=\"https:\u002F\u002Fwww.postgresql.org\u002Fdocs\u002F\" target=\"_blank\" rel=\"noopener noreferrer\">official PostgreSQL documentation\u003C\u002Fa>. This guide covers going live on a ServOrbit VPS; the vendor documentation remains the reference for fine tuning.","Deploy your PostgreSQL in minutes","Launch a ServOrbit Cloud VPS with a preconfigured Docker template, NVMe SSD and dedicated CPU: the ideal environment to host PostgreSQL without per-GB billing.","Configure my Cloud VPS","\u002Fvps-cloud",[80,94,107],{"id":81,"slug":82,"title":83,"excerpt":84,"readTime":85,"views":86,"isPinned":13,"publishedAt":87,"category":88,"categories":89,"featuredImage":23,"bgImage":24,"posterImage":91,"relatedSolution":92},57,"heberger-mysql-vps","Hosting MySQL on a VPS","Host MySQL on your Cloud VPS: Docker deployment, hardening, InnoDB tuning, and automated backups, step by step.",7,509,"2026-04-24T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[90],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-mysql-vps-poster.svg",{"categorySlug":18,"appSlug":93},"mysql",{"id":95,"slug":96,"title":97,"excerpt":98,"readTime":85,"views":99,"isPinned":13,"publishedAt":100,"category":101,"categories":102,"featuredImage":23,"bgImage":24,"posterImage":104,"relatedSolution":105},58,"heberger-redis-vps","Hosting Redis on a VPS","Deploy Redis on your Cloud VPS: ultra-fast cache, sessions, and queues, with persistence, security, and memory tuning.",546,"2026-04-23T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[103],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":18,"appSlug":106},"redis",{"id":108,"slug":109,"title":110,"excerpt":111,"readTime":11,"views":112,"isPinned":13,"publishedAt":113,"category":114,"categories":115,"featuredImage":23,"bgImage":24,"posterImage":117,"relatedSolution":118},59,"heberger-mongodb-vps","Hosting MongoDB on a VPS","Host MongoDB on your Cloud VPS: Docker deployment, replica set, authentication, indexing, and controlled backups.",583,"2026-04-22T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[116],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-mongodb-vps-poster.svg",{"categorySlug":18,"appSlug":119},"mongodb",1785628445807]