[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-heberger-mysql-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":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},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,false,"2026-04-24T00: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-mysql-vps-poster.svg",{"categorySlug":18,"appSlug":27},"mysql","MySQL powers a huge part of the web: WordPress, Magento, Laravel, and thousands of PHP applications. Self-hosting it on a VPS gives you dedicated performance, full control over the InnoDB configuration, and predictable costs, far from the limits of shared hosting.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why self-host MySQL on a VPS","On shared hosting, your MySQL database shares RAM and I\u002FO with hundreds of other sites, and you can change neither `innodb_buffer_pool_size`, nor the SQL modes, nor the engine version. On a VPS, you have dedicated resources, you choose between MySQL 8.x and MariaDB, and you access the `my.cnf` file to tune every parameter. It's the right choice for an e-commerce store, a high-traffic CMS, or an API that needs fast transactions and a generous buffer pool. You also manage your own users, your table-level grants, and your master-replica replication strategy.",{"type":35,"title":36,"items":37},"ul","The concrete benefits of a self-hosted MySQL",[38,39,40,41,42,43],"Dedicated resources: the entire InnoDB buffer pool for your data, with no noisy neighbors.","Full access to `my.cnf`: `innodb_buffer_pool_size`, `max_connections`, strict SQL modes.","Choice of engine: MySQL 8 for JSON\u002FCTE functions, or MariaDB for its additional engines.","Configurable master-replica replication for offloaded reads or disaster recovery.","Logical (`mysqldump`) or physical (`xtrabackup`) backups depending on your volume.","No arbitrary quota on database size or the number of simultaneous connections.",{"type":31,"title":45,"body":46},"Hardware and software prerequisites","A MySQL instance for a WordPress site or a small application runs comfortably on a VPS with 2 vCPU and 2 to 4 GB of RAM with 30 GB of SSD. For Magento, PrestaShop, or real e-commerce traffic, go up to 4 vCPU and 8 GB of RAM, because the InnoDB buffer pool must be able to hold most of your hot dataset. On the software side: Ubuntu 22.04\u002F24.04 LTS, Docker and Docker Compose v2, a dedicated persistent volume, and a domain (e.g., `mysql.mysite.com`) only if remote access is required. Also plan disk space for the binlogs if you enable replication or point-in-time recovery.",{"type":48,"title":49,"steps":50},"steps","Deploying MySQL with Docker in production",[51,54,57,60,63,66],{"title":52,"body":53},"Secure the VPS","Update the system, install Docker, disable password-based SSH login in favor of keys, and close port 3306 to the outside with `ufw deny 3306`. MySQL should listen only on the container's internal network.",{"title":55,"body":56},"Define the docker-compose.yml","Declare a `mysql:8.4` service, mount a volume on `\u002Fvar\u002Flib\u002Fmysql`, and pass `MYSQL_ROOT_PASSWORD`, `MYSQL_DATABASE`, and `MYSQL_USER` through a `.env` file. Also mount a `conf.d\u002Fcustom.cnf` file as read-only for your custom settings.",{"title":58,"body":59},"Harden the installation","After `docker compose up -d`, run the equivalent of `mysql_secure_installation`: remove anonymous users, forbid remote root login, and create a dedicated application account with a `GRANT` limited to a single database. Never use the root account from your application.",{"title":61,"body":62},"Optimize InnoDB","In your `custom.cnf`, set `innodb_buffer_pool_size` to about 60-70% of the VPS RAM, `innodb_flush_log_at_trx_commit=2` for a good performance\u002Fdurability trade-off, and `max_connections` according to your real load. Enable the slow query log to track down expensive queries.",{"title":64,"body":65},"Expose over TLS if necessary","If an external application must connect, enable TLS encryption on the MySQL side and place access behind an SSH tunnel or a proxy. Avoid exposing 3306 directly: favor private network access between your VPSs.",{"title":67,"body":68},"Schedule backups","Schedule a daily `mysqldump --single-transaction` via cron for consistent, lock-free dumps, compress them, and archive them off the VPS. For large databases, switch to Percona XtraBackup for fast physical backups.",{"type":70,"body":71},"tip","Enable the binlogs (`log_bin` + `binlog_format=ROW`) from the start: they are the key to point-in-time recovery. Combined with a full weekly `mysqldump`, they let you replay every transaction up to the second before an incident. And if you set up a replica on a second VPS, those same binlogs feed the replica in real time for your offloaded reads.","Host your MySQL on a high-performance VPS","The ServOrbit Cloud VPS with a ready-to-use Docker template gives you NVMe SSD, dedicated CPU, and guaranteed resources to run MySQL without compromise.","Launch my Cloud VPS","\u002Fvps-cloud",[77,91,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":82,"views":83,"isPinned":13,"publishedAt":84,"category":85,"categories":86,"featuredImage":23,"bgImage":24,"posterImage":88,"relatedSolution":89},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,"2026-04-25T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[87],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":18,"appSlug":90},"postgresql",{"id":92,"slug":93,"title":94,"excerpt":95,"readTime":11,"views":96,"isPinned":13,"publishedAt":97,"category":98,"categories":99,"featuredImage":23,"bgImage":24,"posterImage":101,"relatedSolution":102},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},[100],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":18,"appSlug":103},"redis",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":82,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},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},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fheberger-mongodb-vps-poster.svg",{"categorySlug":18,"appSlug":116},"mongodb",1785628442380]