I’ve recently set up my server with HestiaCP and configured a WordPress website, which is currently running on Apache (default template). However, I’m much more familiar with Nginx and would prefer to switch the web server configuration of my existing domain from Apache to Nginx.
I’m aware that HestiaCP supports both Apache and Nginx (also Nginx as reverse proxy), but I’m unsure how to safely migrate an already configured and running domain — including SSL, PHP-FPM, and rewrite rules — over to Nginx without breaking the current setup.
My questions:
What’s the recommended and safest way to convert an existing domain from Apache to Nginx in HestiaCP?
Are there any risks I should be aware of (e.g. SSL, WordPress permalinks, or .htaccess rules)?
Do I need to manually adjust any rewrite rules after switching the web template?
Will HestiaCP automatically apply a suitable Nginx config when I switch the template in the panel?
Any help, tips, or a step-by-step guide would be highly appreciated.
HestiaCP – Switching from Apache to Nginx + PHP-FPM (Migration Guide)
Step-by-Step Instructions
SSH into your server
ssh youruser@yourserver
Switch to root
sudo su -l
Download the official migration script
cd /root
wget https://raw.githubusercontent.com/hestiacp/hestiacp/main/install/upgrade/manual/migrate_ngnix_apache_nginx-php-fpm.sh
chmod +x migrate_ngnix_apache_nginx-php-fpm.sh
Run the script
./migrate_ngnix_apache_nginx-php-fpm.sh
Done
Your server is now running Nginx + PHP-FPM only. Verify everything works (websites, PHP apps, SSL, etc.). Rollback if needed using snapshots or backups.
Apache2 is still active, but no longer needed.
I can safely disable it and everything continues to work as expected.
Would it make sense to add systemctl disable --now apache2 to the migration script?
Or am I mistaken?