[{"data":1,"prerenderedAt":123},["ShallowReactive",2],{"seo-verification":3,"blog-hosting-mysql-on-a-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"slugs":9,"title":12,"excerpt":13,"readTime":14,"views":15,"isPinned":16,"publishedAt":17,"category":18,"categories":24,"featuredImage":26,"bgImage":27,"posterImage":28,"relatedSolution":26,"intro":29,"sections":30,"ctaTitle":73,"ctaBody":74,"ctaButton":75,"ctaUrl":76,"relatedPosts":77},57,"hosting-mysql-on-a-vps",{"fr":10,"en":8,"ar":11},"heberger-mysql-vps","استضافة-mysql-على-خادم-vps","Hosting MySQL on a VPS","Host MySQL on your Cloud VPS: Docker deployment, hardening, InnoDB tuning, and automated backups, step by step.",3,0,false,"2026-04-24T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},6,"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[25],{"id":19,"name":20,"slug":21,"color":22,"icon":23},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-mysql-vps-poster.svg","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.",[31,35,45,48,70],{"type":32,"title":33,"body":34},"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":36,"title":37,"items":38},"ul","The concrete benefits of a self-hosted MySQL",[39,40,41,42,43,44],"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":32,"title":46,"body":47},"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":49,"title":50,"steps":51},"steps","Deploying MySQL with Docker in production",[52,55,58,61,64,67],{"title":53,"body":54},"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":56,"body":57},"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":59,"body":60},"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":62,"body":63},"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":65,"body":66},"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":68,"body":69},"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":71,"body":72},"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",[78,95,110],{"id":79,"slug":80,"slugs":81,"title":84,"excerpt":85,"readTime":86,"views":15,"isPinned":16,"publishedAt":87,"category":88,"categories":89,"featuredImage":26,"bgImage":27,"posterImage":91,"relatedSolution":92},56,"postgresql-on-a-vps-a-reliable-and-controlled-database",{"fr":82,"en":80,"ar":83},"heberger-postgresql-vps","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.",4,"2026-04-25T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[90],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":93,"appSlug":94},"databases","postgresql-stack",{"id":96,"slug":97,"slugs":98,"title":101,"excerpt":102,"readTime":86,"views":15,"isPinned":16,"publishedAt":103,"category":104,"categories":105,"featuredImage":26,"bgImage":27,"posterImage":107,"relatedSolution":108},58,"hosting-redis-on-a-vps",{"fr":99,"en":97,"ar":100},"heberger-redis-vps","استضافة-redis-على-خادم-vps","Hosting Redis on a VPS","Deploy Redis on your Cloud VPS: in-memory cache, sessions, and queues, with persistence, security, and tuning.","2026-04-23T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[106],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":93,"appSlug":109},"redis-stack",{"id":111,"slug":112,"slugs":113,"title":116,"excerpt":117,"readTime":14,"views":15,"isPinned":16,"publishedAt":118,"category":119,"categories":120,"featuredImage":26,"bgImage":27,"posterImage":122,"relatedSolution":26},59,"hosting-mongodb-on-a-vps",{"fr":114,"en":112,"ar":115},"heberger-mongodb-vps","استضافة-mongodb-على-خادم-vps","Hosting MongoDB on a VPS","Host MongoDB on your Cloud VPS: Docker deployment, replica set, authentication, indexing, and controlled backups.","2026-04-22T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[121],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-mongodb-vps-poster.svg",1787581002297]