contabo-vps-server

How to install WordPress in VPS Hosting: Contabo(Without CyberPanel)

In this tutorial guide, we gonna explore how to install WordPress in VPS hosting with Contabo using only LAMP without Cpanel. What you’ve heard is true. If you can follow this ultimate guide you can save a lot of money by avoiding cPanel monthly costs and Webmin Resources that are not actually required.

WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites.

What do we mean when we say hosting, so hosting a website or a web application simply means uploading the files as well as the database into a public server so it can be accessible Online over the internet.

How to install WordPress in Contabo VPS Hosting

Hosting Options.

Now when you want to host a website or especially a web application. In this guide to our scenario, It’s you have mainly 2 Methods:

Shared Hosting: Method 1

 In short, Publishing your website might be on the same server as 500+ other people, like Godaddy, Hostinger, and Bluehost.

VPS Hosting: Method 2

In this setup, you will host your website on your own server with a Unique IP address, so you will have a server only for you. which is called a VPS or a Virtual Private Server.

Which one is better?

I guess explaining more in-depth technical stuff takes more time, but to be honest, VPS is definitely a better option where you will have your own server with full manageability and better performance.

But you may ask us that shared hosting is a lot cheaper, then you are wrong, With Contabo VPS services you can start with a 4.99 € per month. Obviously, which is the same pricing for almost 90% of shared hosting services provides.

The only drawback here is, that it requires some more technical skills to set up and configure, and that’s the only reason 63% of people choose to go with shared hosting. but fortunately, you are here in the step-by-step guide, where you will see how things will go really easy!

Contabo: Virtual Dedicated Server

Install WordPress on Contabo

Let’s Start!

We are ready to Install WordPress on Contabo VPS Server

Get a Domain Name.

Getting a Domain name is simple as getting a Pizza, all you need to do is to get a domain name from any Domain registrar company like GoDaddy or NameCheap. Buy a Domain Name as you can even get one for 1$ per year.

We highly recommend getting a .com domain that reflects your business. It’s not a big deal if you already have one you can just skip this, and continue to get a VPS Server.

install-WordPress-in-Contabo-VPS-Hosting-Godaddy-domain-name

Search for a perfect domain name that reflects your business. Once you find the available domain name of your choice

install-WordPress-in-Contabo-VPS-Hosting-Godaddy-domain-name-select
Click on – Continue to Cart

In case you need any Protection for your domain you can check out the list on this page

install-WordPress-in-Contabo-VPS-Hosting-Godaddy-domain-name-checkout
Click on – Continue to Cart

Make sure the registration is selected for 1 Year. Because by default GoDaddy suggests it for 5 Years.

install-wordpress-domain-name-godaddy

Awesome! We got our domain name for your business.

Get a VPS Server From Contabo

1: Open Contabo Website.

Using any web browser navigate to Contabo VPS Server

install-WordPress-in-Contabo-VPS-Hosting
Click on – View all cloud VPS

You can see various VPS configurations to start with. You can go with the cheapest option to Install WordPress, that’s a great choice because it has excellent performance and speed which is more than enough compared to shared hosting.

After you grow your business with a lot of traffic, you can scale to a more robust VPS with Higher resources.

2: Set VPS Options

In this guide, I’ll go with VPS S Plan which includes:

install-WordPress-in-Contabo-VPS-Hosting-cloud

And that’s an amazing deal where you save double the amount. On the Next Page, you will need to select some options,

Our first step is to select the term length of our server, It’s totally up to you.

And Region has to be well played because that should be your targeted audience and choose your Preferred Storage ( Pro Tip: SSD Storage )

In the Image Option, Select – LAMP-Ubuntu 20.04

install-WordPress-in-Contabo-VPS-Hosting-LAMP
LAMP – Select Ubuntu 20.04

Then, you need to enter your root username and password for the login

install-WordPress-in-Contabo-VPS-Hosting

We don’t need any Add-ons. So will skip this

Now, Just click on Next to the billing page, and confirm your order.

I think other steps are simple and self-explanatory. Here you’ll be asked to create an account if you don’t have one already. It can be done is simple steps.

In next 24 hrs (max _30mins). Contabo Team will setup the Server and send the details to your email as below.

install-WordPress-in-Contabo-VPS-Hosting-email-IP-address

Fabulous! You Got Your Own Server.

Map Domain Name to your VPS Server.

Now we have a Domain name and a Private VPS Server. But the problem is they are not connected!

You can access your VPS Server now through the IP address that contabo Team has sent you by email. Of course, I understand we don’t want to access our WordPress website through an IP address! we want to use our domain name so let’s make it simple.

So without any ado, we are going to map the domain name to our VPS IP address, Only then we will be able to access your VPS server and the WordPress website. But we can use this for both the domain name and the IP address.

Configure your DNS Records:

Open the DNS management option in your Domain Provider. In this guide, it’s GoDaddy. This is the same operation in every domain provider service.

Here Edit of the main A Record:

install-wordpress-contabo-vps-godaddy-dns-record

In A record, @  YOUR SERVER IP. (Enter your server IP address on Data section).

Done! You’re doing a great job!

Install WordPress on VPS.

Our server is ready for installation! You can see, it’s not as complicated as you think😀

The next step is to connect our server to start working. For that, you need to Connect your VPS server using any SSH client like putty. so Let’s get started!

install-WordPress-in-Contabo-VPS-Hosting-putty

Enter either your domain name or IP address and Click – Open

  • Once you click on open
  • Allow this by clicking accept on Putty notification bar

install-wordpress-vps-server-contabo-putty-accept

Now, It will ask you to log in, just enter “root” as the user, then enter your password which is sent to you by email.

install-WordPress-in-Contabo-VPS-Hosting-putty-root

Note: while typing the password, putty will now show it for security reasons, but It’s there, just type it! The best way to do this is to copy the password and Just Right Click on the mouse to paste your password into Putty.

install-WordPress-in-Contabo-VPS-Hosting-putty-password

And you are In! ✔️ Great!

Step 1 – Creating a MySQL Database and User for WordPress

If you don’t know what is MySQL for newbies. In simple, WordPress uses MySQL to manage and store site and user information.

But we have MySQL installed already as part of the LAMP Stack, So, we just need to make a database and a user for your WordPress. To get started,

log into the MySQL root (administrative) account by issuing this command:

mysql -u root -p

You will be prompted for the root password, just write or paste it and press Enter.

First, we need to create a separate database that WordPress will control.

You can name this whatever you would like, In this article, we will be using WordPress in this guide to keep it simple and clear.

Next, create the database for WordPress by running this command:

CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Note: Every MySQL statement must end with a semi-colon (;)

Nice! What we are going to do now is to create a separate MySQL user account that will be exclusively used to operate our new database.

Here is a Pro-tip for the readers, Creating one-function databases and accounts is a good idea from a management and security point of view. In this ultimate guide, We will use the name WordPress_user  Feel free to change this if you’d like.

What’s our next move? We are going to create this account, set a password, and grant access to the database we created. We can do this by typing the following command.

Remember to choose a strong password here for your database user:

CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'Enter_Your_Password_Here';
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'enter_a_custom_password_here';

You now have a database and user account. Specifically made for WordPress.

The last step is to flush the privileges so that the current instance of MySQL knows about the recent changes we’ve made:

FLUSH PRIVILEGES;

Exit out of MySQL by typing:

EXIT;

Done! ✔️

Step 2 – Installing Additional PHP Extensions.

WordPress and many of its plugins leverage additional PHP extensions.

In this session, We will download and install some of the most popular PHP extensions to use with WordPress by typing:

sudo apt update

Then

sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip

We need to restart the Apache web service to load these installed new extensions. But we can do this in the next section.

If you are returning here to install additional plugins, you can restart Apache now by typing:

sudo systemctl restart apache2

Step 4 – Downloading WordPress

Now our server software is configured. So let’s download and set up WordPress.

Note: For security reasons, in particular, it is always recommended to get the latest version of WordPress from their site.

To do that, change the current directory to /html by running the following command:

cd /var/www/html

Download WordPress Files:

curl -O https://wordpress.org/latest.tar.gz

Here, we need to extract the compressed file to create the WordPress directory structure:

tar xzvf latest.tar.gz

So now we have WordPress Downloaded, our server is configured, and we need to attach things together.

Since there are several tiny tasks to do, I felt that it’s better to show you this in a small video. All commands used in the video will be attached here in the guide, so please just follow up!

Step 5 – Adjusting Apache’s Configuration

Brilliant, Now our WordPress is installed, we just need to configure apache so we can access our website using our domain name.

To do so, open WinSCP (mentioned in the video) again and navigate to this directory: /etc/apache2/sites-available/

Here, we need to create a new empty file and name it “domain.conf” (Note: Change “domain” to your domain) Open domain.conf Then copy and paste the content below into the file and save.

<VirtualHost *:80>
     ServerAdmin admin@domain
     DocumentRoot /var/www/html/
     ServerName domain
     ServerAlias domain

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

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

</VirtualHost>

Important: replace “domain” with your domain name

Enable configuration in apache and restart the service.

Now copy and run the following commands to finish the setup:

sudo a2ensite domain.conf
sudo a2enmod rewrite
sudo systemctl restart apache2.service 

Amazing! You are almost done 😀

Step 6 – Configuring the WordPress Directory

Before we open WordPress and finish the installation. We need to adjust some options in our WordPress directory.

Adjusting the Ownership and Permissions

One of the most important setups: we need to do is to accomplish appropriate file permissions and ownership and basic setting up

So let’s start by giving ownership of all the files to the www-data user and group. This is the user that the Apache webserver runs as, and Apache will need to be able to read and write WordPress files in order to serve the website and perform automatic updates in the future.

Update the ownership with chown:

sudo chown -R www-data:www-data /var/www/html

Next, we will run two find commands to set the correct permissions on the WordPress directories and files: To do so, run the commands below

sudo find /var/www/html/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/ -type f -exec chmod 640 {} \;

These two commands should be reasonable permission set to start with. Some plugins and procedures might require additional tweaks.

Setting up the WordPress Configuration File

Now, we need to make some major changes to the main WordPress configuration file (wp-config mentioned in the video above)

When we open the file, our first job is to adjust some secret keys to provide some security for our installation. WordPress provides a secure generator for these values so you do not have to try to come up with good values on your own.

Obviously, these are only used internally, which means it won’t hurt usability to have complex, secure values here.

To grab secure values from the WordPress secret key generator, type in putty:

curl -s https://api.wordpress.org/secret-key/1.1/salt/

Once you run the above command you will get unique values that look something like this:

Outputdefine('AUTH_KEY',         '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H');
define('SECURE_AUTH_KEY',  'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3');
define('LOGGED_IN_KEY',    'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88');
define('NONCE_KEY',        'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g');
define('AUTH_SALT',        'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES  07VC*Lj*lD&?3w!BT#-');
define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY');
define('LOGGED_IN_SALT',   'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|');
define('NONCE_SALT',       'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%');

These commands are configuration lines that we can paste directly into our configuration file to set secure keys. Copy the output you received now.

Now, open the WordPress configuration file with WinSCP and replace the lines like in the image below:

Step 7 (last step)– Completing the Installation Through the Web Interface.

The server configuration is completed. Now, we can complete the installation through the web interface.

In any web browser, navigate to your server’s domain name or public IP address:

http://server_domain

This means your domain name or IP address

Select the language you would like to use:

Congratulations! This is WordPress Installed and ready on Your Contabo VPS Server.

Feel Free to clarify your doubts in the comment section below.

Leave a Comment

Your email address will not be published.

Share via
Copy link
Powered by Social Snap