Install VPS (Virtual private server) with WordPress

With VPS (Virtual private server) we get more power and full control for quite equal price in comparing with shared hostings. It started from 5$ per month (e.g. Contabo or Server4You). The main disadvantage from shared hostings is requiring installation and configuration.

It looks complicated but it contains only 3 main steps.

  1. Choose and setup server
  2. Install and configure control panel
  3. Deploy WordPress

Choose and setup server#

Just choose any liked provider and server type. We recommend to use next providers due to good prices and given power: Contabo (excellent combination of price and German’s quality, and many awards), Server4You (Europe and USA region), OVHCloud, Hostens, CloudWays (Linode is recommended for India region), MakeCloud (Asia and Russia region).

Let’s look at the process in Contabo.

  1. Go to the VPS page (or VDS or VPS with big HDD storage if needed), select the needed plan and click the ‘Select’ button.

    contabo-plans

  2. Next, select the needed set of options. Please, choose Ubuntu 20.* (it’s important) as operating system. Also, set root’s login and password – it will be required in further steps. Then, click ‘Next’.

    contabo-options

  3. Do payment (note that the server installation fee depends on the selected payment period).
  4. Now, wait for a letter from Contabo about the completion of the installation and server’s IP address. Now you have become the owner of a VPS server!
  5. Finally, set the new server’s IP address for our site name.
    1. If previous site is needed to be alive while configuring the new one, real DNS adjusting should be done as the last step (after installing WordPress part). And the new IP should be temporary set by using Awesome Host Manager Chrome Extension by adding mapping of IP to domain name.

      awesomehostman-settings

      After testing is complete, the temporary mapping should be removed and the next step should be done finally.

    2. Below is how DNS adjusting can be done via CloudFlare for site mysite.com in DNS settings.

      cloudflare-site-dns-change-ip

Install and configure control panel#

To save money, we will install popular free aaPanel that it is very powerful and flexible. FastPanel is also free, but it has smaller features. Also, many hosting providers offer paid control panels like powerful cPanel – it can be definitely used too.

Install#

  1. Run any SSH client (Mac, Windows), connect using server’s IP address, and login there using and root’s login and password that were setup while server installation.
  2. Begin installation process by typing below command and pressing enter:

    sudo apt-get update && sudo apt-get install wget && sudo wget http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && sudo bash install-ubuntu_6.0_en.sh

    During installation, please, type y to the question Do you want to install aaPanel to the /www directory now?(y/n) and type yes to the question Do you need to enable the panel SSL? (yes/n).

  3. After successful installation, information with a panel’s Web-address, login and password for entering the control panel will be displayed, for example:

    ==================================================================
    Congratulations! Installed successfully!
    ==================================================================
    aaPanel: https://192.168.100.31:7800/c2a6f9dd
    username: abc
    password: ef1e70fe
    Warning:
    If you cannot access the panel,
    release the following port (7800|888|80|443|20|21) in the security group
    ==================================================================
    Time consumed: 2 Minute!

Note. On some hostings (except Contabo), it will be necessary to open the specified ports in the firewall manually.

Configure#

  1. Enter in browser provided address (e.g. https://192.168.100.31:7800/c2a6f9dd).

    aapanel-address

    Then, login to our control panel via provided username and password.

    aapanel-login

  2. Setup packages. Choose default set if not sure.

    aapanel-packages-choosing

    Then wait for installation completion. It can take some time, please, be patient.

    aapanel-packages-installing

    Now the window can be closed.

    aapanel-packages-install-finished

  3. Turn off ‘putenv’ in PHP’s settings.

    aapanel-apps-php-settings

    aapanel-php-settings-disfuncs

  4. Enable SSL for ‘phpMyAdmin’.

    aapanel-apps-phpmyadmin-settings

    aapanel-phpmyadmin-settings-security

    aapanel-security-add-phpmyadmin

  5. Add and configure site.

    aapanel-website-add

    If NGINX is used (it is by default) then setup WordPress rewrites.

    aapanel-website-configure-rewrite

  6. Set site’s SSL.

    aapanel-website-configure-ssl

Deploy WordPress#

Two ways:

Move or copy existed installation#

It can be done by:

  • It is more complex but it allows to copy large database and files.

  • Using Duplicator or UpdraftPlus plugin

    It is simpler but there can be problems with copying large data due to PHP often has limits to file size and execution time.

Note. If new site doesn’t work then there will be a need to correct some configuration files and database tables that is out of scope of current manual due to complexity and variability of possible issues.

Manual mode#

There will be needed a copy of site’s directory content as zip file e.g. files.zip (it should contain files like ‘wp-config.php’ and all other files from WordPress directory). Also, there will be needed a database copy as sql or sql.gz file e.g. database.sql.gz. It can be made manually or got from backup.

  • Upload files.zip file to our new website path.

    aapanel-files-sitepath-upload-wpfiles

    Then, extract it.

    aapanel-files-sitepath-unzip-wpfiles

  • Import database database.sql.gz file. When importing is finished the window can be closed.

    aapanel-databases-site-import

Using Duplicator plugin#

Download and install Duplicator plugin on the source site. Ensure that backup exists in source site or make it.

  • Now, just upload (as in manual mode) all created files to our new website path.
  • Then in browser run site’s name appended with installer.php e.g. https://mysite.com/installer.php and follow onscreen instructions.

Using UpdraftPlus plugin#

Download and install UpdraftPlus plugin on the source site. Ensure that backup exists in source site or make it.

  • Create new WordPress destination installation and install UpdraftPlus plugin there.
  • Now, just upload (as in manual mode) all backed up data to our new website path under wp-config/updraft directory, e.g. /www/wwwroot/mysite.com/wp-config/updraft.
  • Finally, in destination site admin in ‘Settings -> UpdraftPlus Backups’ run searching new files and restore found backup.

New installation#

  • Upload and extract (as in manual mode) needed ZIP WordPress archive to /www/wwwroot.
  • Then delete existing website directory (e.g. mysite.com) and rename wordpress directory to website directory’s name.
  • Then in browser open website name (e.g. https://mysite.com) and follow onscreen instructions.

Finish#

If the previous site was kept alive while instilling the new one then now a temp DNS can be disabled and the new IP can be set in DNS settings.

Leave a Reply