WordPress is currently the most popular CMS in the world. Millions of webmasters use it to create their websites. It is newbie friendly and has a very simple installation process. But things get little complicated on unmanaged VPS. If you’re planning to use an unmanaged VPS, you can use instructions on this page to install WordPress on Ubuntu 20.04 VPS with Virtualmin & Nginx.
The WordPress setup this tutorial produce is focused on performance. We’ll be building a high-performance web server with Virtualmin v7.1 GPL, Nginx v1.22, PHP v8.0 and MySQL v8. It’s a well-known fact that WordPress is faster on nginx. And Virtualmin gives a nice GUI to manage your VPS.
Prerequisites
This tutorial requires you to have a Ubuntu 20.04 VPS. Which you can get from one of my recommended VPS providers. And then complete following steps,
Completing those steps build the environment for WordPress on your VPS. You may ignore optional steps. But I recommend completing them prior to installing WordPress.
Need WordPress Installed?
Would you rather have an experienced Linux Server Administrator configure your VPS and install WordPress for you? Get it done the right way!
- Virtualmin Control Panel
- Nginx v1.22 Webserver
- PHP v8.0 and MySQL v8
- Free SSL for WordPress
- And more...
Monthly VPS Management
Get a professional Linux Server Administrator maintain your VPS on daily basis for a small monthly fee. Our service include,
- Daily Malware Scanning
- Daily Off-site Backups
- Enhanced Server Security & Firewall
- Weekly Server Updates & patches
- And more...
Download WordPress
Assuming you have everything above in place, you can now install WordPress on your domain or subdomain. But to do so, you need to login to your VPS with domain’s admin user. Not the root user. Once logged in, run following command to change the current directory to domain’s web directory,
cd $HOME/public_html
Following commands will download and extract WordPress package,
wget http://wordpress.org/latest.tar.gz tar --strip-components=1 -xvf latest.tar.gz rm latest.tar.gz
WordPress should be ready to install now. But there’s one more thing we should do before installing it.
Add Nginx Rewrite Rules for WordPress
nano /etc/nginx/sites-available/example.com.confReplace example.com with your domain name. Look for following line within the file (Ctrl+W).
fastcgi_param HTTPS $https;Add this rule BELOW it,
location / { try_files $uri $uri/ /index.php?$args; }File should look like this, Hit Ctrl+X to save changes and close the file. Finally restart Nginx,
service nginx restartYour server is now fully configured for WordPress. You now run the WordPress install to complete the installation.
I am trying to install WordPress on local server using WAMP. I am not able to install it due to database issue. Is there any easy alternative like softaculous available for WAMP?
I’m sorry, I’m not able to help you with WAMP.
Other pages and posts work but the homepage is blank, please help.
Hey,
thanks for all these useful guides!
One point I’m missing, where can I find the key to connect ssh with the domain’s admin user? I only have the one created for the root.
There’s no SSH key for that account. You have few options though,
* Login to root and switch to admin user with following command,
su username
* Enable password authentication
* Generate new SSH key for a user (I haven’t covered this one yet)
thanks for the guideline, I have followed all the step till install WordPress. when opening my domain in my browser Under Construction page opens, How I can access the control panel to manage. I normally enter (mydomain.com/wp-admin) is that correct
hi there
when run this command “cd $HOME/public_html” its return -bash: cd: /home/ubuntu/public_html: No such file or directory
that could be the reason for not able to install the WordPress
Hwllo, is it possible to make some script that
nano /etc/nginx/sites-available/example.com.conf
Automatacly add
ocation / {
try_files $uri $uri/ /index.php?$args;
}
So don’t need to change these settings after every wordpress install?
Best Regards
I think you can to this by editing Server Template, check under Plugin Options.