How to install WordPress on VPS on Hostinger
Use Hostinger's one-click WordPress template in hPanel to rebuild your VPS OS, run the interactive OpenLiteSpeed setup script via browser terminal, point your domain DNS to the VPS IP, then complete the WordPress installer in your browser. The process takes 30-45 minutes including DNS propagation. SSL is automatically enabled via Let's Encrypt.
Prerequisites
- Hostinger VPS plan (KVM recommended)
- Domain name ready to point to VPS IP
- hPanel login credentials
- VPS root username and password from SSH access tab
- Basic familiarity with DNS records
Step-by-Step Instructions
Log in to hPanel and access your VPS
Change OS to WordPress template
Open Browser Terminal for SSH
Run interactive OpenLiteSpeed setup script
y (yes) for defaults like SSL setup and automatic updates, or n (no) as needed. Press Enter through all questions until completion message (e.g., "OpenLiteSpeed installed successfully").Point domain to VPS IP via DNS
@ (root domain), Value as your VPS IP from hPanel VPS Overview, TTL default 14400 (4 hours). Wait 5-30 minutes for propagation; verify with tools like WhatsMyDNS.Access and complete WordPress installer
http://your-domain.com or http://your-vps-ip. Select installation language (default English). Enter Site title (e.g., "My Blog"), Username (avoid "admin", use "wpuser"), strong Password (12+ chars), and Email. Click Install WordPress; success redirects to wp-admin login.Verify and secure with SSL
https://your-domain.com. If HTTPS not forced, in terminal run: /usr/local/lsws/admin/misc/admpass.sh (set admin password, default user admin). Access OpenLiteSpeed admin at https://your-vps-ip:7080 to enforce HTTPS redirects.Access WordPress dashboard
your-domain.com/wp-admin and log in with your admin credentials. Customize themes via Appearance, add plugins, and start building your site.Common Issues & Troubleshooting
"Error Establishing a Database Connection"
Verify MySQL credentials in <code>wp-config.php</code> via file manager: check database name, username, password, host. Reset password in hPanel <strong>Databases → Management</strong> → three dots → <strong>Change Password</strong>. If persists, delete and recreate the database.
File permission issues after setup
Set directories to 755 and files to 644 via file manager or terminal (<code>chmod 755 directories; chmod 644 files</code>). Focus on <code>/wp-content</code> and root WordPress files.
DNS not propagating or site unreachable
Confirm A record points to correct VPS IP. Wait full TTL (up to 4 hours), clear browser cache, or test with WhatsMyDNS. Temporarily use VPS IP directly.
SSL not active or mixed content warnings
Run <pre><code>/usr/local/lsws/admin/misc/admpass.sh</code></pre> in terminal, access <code>https://your-vps-ip:7080</code>, enable HTTPS redirects in OpenLiteSpeed admin.
Script fails or OpenLiteSpeed not starting
Ensure VPS used fresh WordPress template (no prior installs). Rebuild OS if needed. Check hPanel status and terminal logs for errors.