How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL

January 9, 2019 0 By Aman Potlia
How To Install WordPress on Vultr VPS with Free Let's Encrypt SSL

How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL:- Hello Friends, Welcome Back, This Time I Come Up With A Guide On How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL. As You All Know Vultr Is Also A Populer Cloud Hosting That Provide Best Services At Cheap Price. So Many User Already Using Their Services And They Are Happy With It.

I Am Also Using Vultr VPS For Newtricksinfo Hosting. During Setup My Blog, I Found That There Are Not Much Info About How To SetUp WordPress On Vultr. So, I Think I Can Help Other, That’s Why I Am Writing This Guide On How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL. In This Guide, I Provide You Two Methods To Install WordPress On Vultr. First Method Are Installing WordPress Using Their Application Section And The Second Method Are Installing It Manually On The Latest Ubuntu 18.10 x64. I Recommend Using Second Method, Because Using That Method You Will Get Best And Latest Environment To Run WordPress, Like php7.2 And MariaDB With Latest Ubuntu OS.

Now Its Depend On You, Which Method You Select, In First Method You Will Get php7.0 And WordPress 4.9.8 Pre-Installed. You Also Need To Manage It Like Removing WP Admin Login Prompt And Installing Let’s Encrypt SSL Certificate. So, If You Have Already Registered On Vultr Then Login Your Account And Follow Below Steps And If You Not Yet Registered On Vultr Then Register By Visiting HERE.

Guide On How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL

Here Are A Complete Guide On How To Install WordPress On Vultr VPS Using Their Application Menu And How To Manage It And How To Remove WP Login Prompt And How to Install Free SSL Cartificate On It.

How To Install WordPress On Vultr VPS Using Their Application Menu

  1. First of All, Login Into Your Vultr Account And Proceed To Create A New Server.
  2. First Select Nearest Server Location And Then On Next Option, Click On Application Menu And Then Select WordPress From The List.
  3. Then Select First Plan ($ 5 Plan) If You Are Settings Up A New Blog. Select Other Bigger Plan, If Your Website Is Already Running And Getting More Than 3000 Visitors Daily.
  4. Now Enable IPv6 By Checking Box And Enter Server Hostname.
  5. Then Click On Deploy Now. Now Wait Some Time Until Your Server Get Ready. After Server Ready It Show You Status As Ready.
  6. That’s It. Now Click On Three Dot Menu () And Select Server Details.
  7. There You Will Found Your Login Details To Complete Remaining Installinon Steps.

Now Visit Your IP Or Domain And Using That Details Complete Your WordPress Installation.

Now We Will Remove WP Admin Login Prompt From Your WordPress Site.

How To Remove WP Login Prompt From WordPress Website Hosted On Vultr VPS

To Remove WP Login Prompt From Your WordPress Website Hosted On Vultr VPS, Just Follow Below Steps Carefully.

1. First of All, Login To Your VPS Using SSH Using Your User Name (root) And Password (You Can View it After Clicking On Eye Icon). You Can Use Vultr Console OR Putty For LogIn Into Your VPS Using SSH.

2. Now After Successful Login Type Below Command There And Press Enter.

ls -al /etc/nginx/conf.d

3. Now After Entering Above Command, Enter Below Given Command And Press Enter.

sudo nano /etc/nginx/conf.d/wordpress_http.conf

This Will Open Nano Editior For You To Edit WordPress.conf File. Now Press Ctrl+i To Start Editing And Find Below Lines And Delete/Remove Them.

location ^~ /wp-admin/ {
auth_basic Restricted;
auth_basic_user_file /etc/nginx/htpasswd/wpadmin;
location ~* \.(htaccess|htpasswd) {
deny all;
  }
location ~ \.php(?:$|/) {
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_sc$
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass php-handler-http;
fastcgi_read_timeout 60s;
}
}

After Cleaning/Deleting This Code, Just Press Ctrl+O To Save This And Click Enter. And Then To Exit From Nano Editor Press Ctrl+X. That’s It, We Removed WP Login Prompt From Your WordPress Blog http Version. New We Remove It From Your https Version. So, Again Type Below Command And Press Enter.

sudo nano /etc/nginx/conf.d/wordpress_https.conf

4. Now Again Follow Step 3 And Again Remove Above Given Code. After Successful Performing Step 3 Again, Now Your Website Are Ready. But Before It. Type Below Command And Press Enter To restart Nginx System.

sudo systemctl reload nginx

That’s It, All Done Now Enjoy. But Wait, Yet Installing Let’s Encrypt SSL Certificate On Your Website Are Remaining. To Know How To Install SSL On WordPress Website Hosted On Vultr And Installed Through Vultr App, Just Visit Bottom of This Post.

Also Read:-

Download Free Nulled WordPress Themes

How To Install WordPress On Vultr VPS ( Ubuntu 18.10 x64) Manually

To Install WordPress On Vultr VPS That Running On Ubuntu 18.10 x64, Just Follow Below Steps. This Is Better A Better Way To Install WordPress On A VPS With Latest Infrastracture, Like php 7.2 And Mariadb. So, If You Are Ready Then Just Follow Below Steps.

Step 1. Installing Apache2 HTTP Server On Ubuntu

To Install, WordPress On A Ubuntu 18.10 x64 Server, First we Install Apache2 HTTP Server On It. To Install Apache Server Just Enter Below Command One By One And Press Enter To Run Them.

 sudo apt updat 
 sudo apt install apache2 

After Using Above Command, You Installed Apache2 On Your Server. Now Use Below Commands To Stop, Start And Enable Apache2 Service To Always Start Up With The Server Boots. Also Run Below Command One By One And Press Enter Button To Run Them.

sudo systemctl stop apache2.service 
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

Now After Enabling Apache2 Service To Always Start Up With The Server Boots, Use Your IP Address OR Domain Name To Check Its Working OR Not. If It’s Working, Then You Can See Apache2 Ubuntu Default Page.

Step 2. Installing MariaDB Database Server

After Installing Apache2, Our Next Step Is Installing MariaDB Server On Our VPS. So Follow Below Steps And Use Below Commands To Install MariaDB Database.

sudo apt-get install mariadb-server mariadb-client 

After Finishing Process of Installation MariaDB On Your Server, Just Enter And Run Below Commands To Stop, Start And Enable MariaDB Service To Always Start Up When The Server Boots.

sudo systemctl stop mariadb.service 
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

After Running Above Command, Enter And Run Below Commands To Secure MariaDB Server By Creating A Root Password And Disallowing Remote Root Access.

sudo mysql_secure_installation 

When You Run This Command, It Will Prompted Some Questions, Answer These Questions As Below Guide.

  • Enter current password for root (enter for none): Just Press Enter Button
  • Set root password? [Y/n]: Y
  • New password: Enter New password
  • Re-enter new password: Repeat New password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

Now After Completing This Process, Restart The MariaDB Services By Entering And Running Below Commands.

sudo systemctl stop mariadb.service 
sudo systemctl start mariadb.service

If Want To Test MariaDB Database, Then Enter And Run Below Command

sudo mysql -u root -p

Now To Exit MariaDB Database And Proceed Further, Enter Below Command

EXIT;

That’s It, Our MariaDB Is Ready. Now Our Next Step Is Installing Php7.2 On Our Server.

Step 3. Installing PHP 7.2 And Related Modules

Now Run Below Commands To Install PHP 7.2 And Related Modules On Your Server

sudo apt-get install software-properties-common 
sudo add-apt-repository ppa:ondrej/php

Then Run Below Command To Update And Upgrade To PHP 7.2

sudo apt update

And At Last Run Below Command To Install Related Modules

sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common  php7.2-sqlite3 php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc  php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip php7.2-curl

After Using Above Command It Automatic Download And Install Related Modules of Php 7.2. If It Give Any Type Error For Any Module Like php7.2-mysql Not Found OR Not Installed, Then Run This Command Alone Like Below

Sudo apt install php7.2-mysql

This Command Will Install That Module Again. Now Enter And Run Below Command To Open PHP default config file for Apache2

sudo nano /etc/php/7.2/apache2/php.in

Now Change Below Listed Lines According To Below Given Parameters Ans Save It By Pressing Ctrl+O And Press Ctrl+X.

file_uploads = On 
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 300M
max_execution_time = 360
date.timezone = America/Chicago

*Pro Tip Use Ctrl+W To Search. Just Serch For First Text Don’t Enter Value. For Example Search Only file_uploads

After Making These Changes, Now Restart Apache2. To Do So, Just Enter And Run Below Command.

sudo systemctl restart apache2.service 

Now After Restart Apache2, If You Want To Test That php 7.2 Properly Installed On Your Server OR Not And Check Its Settings With Apache2 Run Below Command create a phpinfo.php file in Apache2 root directory

sudo nano /var/www/html/phpinfo.php

After Running This Command, Then Press Ctrl+I And Write Below Code There.

<?php phpinfo( ); ?> 

After Writing Code, Save Using Ctrl+O And Exit nano Editor Using Ctrl+X. Now Check It By Visiting IP/phpinfo.php OR example.com/phpinfo.php

After Installing Php 7.2, Its Right Time To Install WordPress. So, We Start With Creating WordPress Database.

Step 4. Creating Database For WordPress

To Creating Database For WordPress, We Login Into Our MariaDB Database Server And When it Prompt For Password Use Your New Password That We Created Above. To Login Type Below Command And Run It

sudo mysql -u root -p 

After Login Using Your New Create Password, Create A New Blank Database By Typing And Running Below Command There

 CREATE DATABASE ap_databas;

After Creating Database, Its Time To Create A Database User With A New Password. Run Below Command To Create A Database User

CREATE USER 'ap_user'@'localhost' IDENTIFIED BY 'type_password_here'; 

Now After Creating Database And Database User, It’s Necessary To Grant The User Full Access To The Database. To Grant The User Full Access To The Database, Run Below Command

GRANT ALL ON ap_database.* TO 'ap_user'@'localhost' IDENTIFIED BY 'type_user_password_here' WITH GRANT OPTION; 

Now Save Changes By Using Below Command

FLUSH PRIVILEGES;

After That, Our Work Done Here, Just Use Below Command o Exit.

EXIT;

It’s Done, Now We Move To Our Next Step.

Step 5. Configure WordPress Site

Now Our Next Step Is To Configure WordPress Site. To Configure WordPress Website, We Create A New Configuration File Called wordpress.conf. To Create This File Just Type And Run Below Command.

sudo nano /etc/apache2/sites-available/wordpress.conf 

Now Press Ctrl+I To Edit File And Enter/Paste Below Code There

<VirtualHost *:80> 
ServerAdmin admin@example.com
DocumentRoot /var/www/html/wordpress/
ServerName example.com
ServerAlias www.example.com

<Directory /var/www/html/wordpress/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Now Save It By Pressing Ctrl+O And Exit Using Ctrl+X.

Step 6. Enabling WordPress Configuration On Apache2 Site

Our Next Step Is, Enable Above Created Virtual Host Configuration OR You Can Say Enabling WordPress Configuration On Apache2 Site. To Enable This WordPress Configuration Just Type And Run Below Commands.

sudo a2ensite wordpress.conf 
sudo a2enmod rewrite

Step 7. Downloading WordPress Content/Package

Now Everything Is Ready. So, Now It’s Time To Download Download And Install WordPress Content/Package. To Do So, Just Type And Run Below Command To Download Latest Version of WordPress.

cd /tmp && wget https://wordpress.org/latest.tar.gz 
tar -zxvf latest.tar.gz
sudo mv wordpress /var/www/html/wordpress

After Downloading WordPress Content, It’s Time To Set Correct Permissions For WordPress Root Directory. To Set Correct Permissions For WordPress Root Directory, Just Type Below Commend And Run It By Pressing Enter Button.

sudo chown -R www-data:www-data /var/www/html/wordpress/ 
sudo chmod -R 755 /var/www/html/wordpress/

Step 8. Configure WordPress To Connect With Database

Now Everything Is Set, And Now Last Step, Configure WordPress To Connect Wih Database. To Do So, Just Type Below Command And Run It To Create WordPress wp-config.php File. This File is A Default Configuration File For WordPress.

sudo mv /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php 

Now Just Type And Run Below Command To Open WordPress configuration file/ wp-config.php

sudo nano /var/www/html/wordpress/wp-config.php 

Now Edit wp-config.php File By Pressing Ctrl+I And Modify It Like Below Example.

// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ 
define('DB_NAME', 'ap_database');

/** MySQL database username */
define('DB_USER', 'ap_user');

/** MySQL database password */
define('DB_PASSWORD', 'new_password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', '');

That’s It, After Changing Highlighted Info In Your File. Use Ctrl+O To Save Changes And Ctrl+X To Exit.

Now Everything Is Configured, Just Type And Run Below Command To Restart Apache2 Web Server.

sudo systemctl reload apache2.service 

Setup Completed, Now Visit Your Domain To Complete Remaining Steps. For Example Visit:- example.com OR If You Are Using IP Then Use IP/Wordpress. Remember You Found Your WordPress Website On Server Name That You Used In server_name Dusing Virtual Host Configuration.

How To Install Free Let’s Encrypt SSL Certificate On A WordPress Website Hosted On Vultr VPS

There Are Two Ways To Install Free Let’s Encrypt SSL Certificate On A WordPress Website Hosted On Vultr VPS. These Ways Depend On Your WordPress Installing Method. If You Used Vultr Application Menu To Install WordPress Then Use Method One OR If You Manually Installed WordPress On Vultr VPS Then Use Method Two.

Installing SSL On WordPress Website That Installed Through Vultr Application Menu

If You Installed WordPress On You Vultr VPS Using Their Application Menu, Then Follow Below Steps To Install Free Let’s Encrypt SSL Cartificate On It.

1. First of All, Login To Your VPS Using SSH Using Your User Name (root) And Password (You Can View it After Clicking On Eye Icon). You Can Use Vultr Console OR Putty For LogIn Into Your VPS Using SSH.

2. Now First We Update Our Server Name According To Our URL/Site Name In Nginx site configuration files. To Do So, First of All We Need To Stop Nginx Services On Our Server.

3. To Stop Nginx Service, After Login To Your VPS, Type Below Command And Press Enter.

sudo nano /etc/nginx/conf.d/wordpress_http.conf

4. Now Find Line Like Below And Replace _ (UnderScore) After Server_name With Your URL/Domain Name. You Can Use Ctrl+i To Start Editing, Ctrl+O To Save Your Editing And Ctrl+X To Exit From Nano Editor. Below Are Example.

You Find Link This:-

server_name _;

Replace It, Like Below

server_name example.com www.example.com

5. After Changing Save It And Exit From Nano Editor And Now Enter Below Command And Press Enter.

 
sudo nano /etc/nginx/conf.d/wordpress_https.conf

Now Here Also Change Your Server Name And After Saving Changes, Exit From Nano Editor.

That’s It, Now Our Server Name Are Updated According Our Domain Name/URL. Now We Are Ready To Install SSL According To Them On Our WordPress Hosting.

To Install Let’s Encrypt SSL Certificate On Our VPS, We Need Install Cerbot On It. To Install Certbot On Your VPS, Enter Below Command And Press Enter Button.

 sudo add-apt-repository ppa:certbot/certbot 

After Completing Process, Enter Below Command And Press Enter Button.

 sudo apt-get update 

Now Again Enter Below Command And Press Enter Button To Run It.

 sudo apt-get install python-certbot-nginx 

That’s It, After Running Above Three Command, You Have Successfully Downloaded And Installed Certbot On Your VPS. Now We Generate SSL Using It. Now We Use Below Command To Generate SSL For Our Server, So Just Enter Below Command And Press Enter Button.

 certbot --nginx --redirect 

This Will Start A Automated Process of Installing SSL On Your Server. Enter Your Email Address To Recieve Notification Related To Your SSL When Prompted (Ask You To Enter Email). On Next Option, Select A To Agree To The Terms of Service. And After That It Will Ask You To Select Whether You Want To Share Your Email With The Electronic Frontier Foundation. This Is Optional, So Select As You Wish. And At Last Press Just Enter Button When Asked For Which Names You Would Like to Activate HTTPS.

Now Only One Thing Left, Upadating Nginx Configuration To Force SSL, To Do So, Just Enter Below Command And Press Enter Button.

 nano /etc/nginx/conf.d/wordpress_http.con 

Now Add Below Links To Your Server Block And Save The File. ( Use Above Given Methods To Edit And Save Files.

if ($scheme = http) {     return 301 https://$server_name$request_uri; }  

All Done Now Use Below Command To Start Nginx Server Again.

As You All Know, This Free Let’s Encrypt SSL Cartificate Are Valid Only For 90 Days. So, Before Your Cartificate Expirection Date Run Below Command To Renew It.

 certbot renew 

That’s It, By Using Above Method You Can Easily Install Free Let’s Encrypt SSL Cartificate On Your WordPress Website That Installed Through Vultr Application Menu.

Installing Free Let’s Encrypt SSL On WordPress Website That Installed Manually Vultr Ubuntu 18.10 x64

To Install Free Let’s Encrypt SSL Certificate On Self Managed WordPress Website Hosted On Vultr Ubuntu 18.10 x64 Server, Just Follow Below Steps. First of All, We Need To Install Let’s Encrypt Client On Your Ubuntu Server. To Install Let’s Encrypt Client On Your Ubuntu Server, Just Type And Run Below Command.

sudo apt-get install python-certbot-apache 

After Install Let’s Encrypt Client On Your Server, Just Type Below Command To Grab Your Free Let’s Encrypt SSL/TLS Certificate The Domain Specified. Make Sure To Replace example.com with your own domain Before Run Below Command.

sudo certbot --apache -m admin@example.com -d example.com -d www.example.com

After running the above commands, you should get prompted to accept the licensing terms. Type A To accept the licensing terms.

On Next Prompt Choose Y To Share Your Email Address With with the Electronic Frontier Foundation OR N For Not Share. And On 3rd Prompt Choose 2 To Make Redirect All HTTP Traffics To HTTPS. After that, the SSL client should install the cert and configure your website to redirect all traffic over HTTPS. This Certificate Are Valid Only For 90 Days, To Renew It, Just Run Below Command.

sudo certbot renew --dry-run 

So This Is The Complete Guide On How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL. Let us know how’s your experience with This Guide How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL Comment Section.

If You Like This Post On How To Install WordPress on Vultr VPS with Free Let’s Encrypt SSL, Then Share It With Your Friends On Social Media By Using Below Buttons.

Subscribe Our E-Mail Newsletter And YouTube Channel For Getting Latest Tips And Tricks In Your Inbox.

(Visited 91 times, 2 visits today)