Skip to main content
Setting Up a CMS Web Development Environment on a VPS - Virtarix Blog

Setting Up a CMS Web Development Environment on a VPS

November 15, 2024 · Blog / Technical Guides

This document provides a detailed process for setting up a web development environment for traditional CMS systems such as WordPress. The guide will walk you through the installation and configuration of essential components like PHP, Nginx, and MariaDB.

Step 1: update package list

Begin by updating your package list. Execute the command: sudo apt update.

Ubuntu terminal showing package-list update output

Step 2: install PHP and essential modules

Once the update is complete, proceed to install PHP along with its common modules by running the following command: sudo apt install php php-cli php-mysql php-xml php-gd php-curl.

Ubuntu terminal showing PHP and module installation output

Step 3: verify PHP installation and install Nginx

To verify the PHP version, type sudo php -v. Next, install the Nginx web server by executing: sudo apt install nginx -y.

Terminal confirming the installed PHP version before Nginx installation

Step 4: check Nginx installation and install MariaDB

After installation, check the Nginx version to ensure it's properly installed. Then, proceed to install MariaDB, a database management system, using the command: sudo apt install mariadb-server.

Terminal showing Nginx installation before MariaDB setup

Step 5: secure MariaDB setup

Secure and configure MariaDB by executing: sudo mysql_secure_installation.

MariaDB secure-installation prompt requesting the database root password

Step 6: configure MariaDB authentication and password

Press Enter at the first prompt. Type n for Unix socket authentication. If you wish to set a password, type y and enter your desired password. Re-enter the password when prompted.

MariaDB secure-installation prompts for root authentication and password settings

Step 7: finalize MariaDB security settings

When prompted to remove anonymous users, type y. To disallow root login, type y again. Remove the test database by typing y. Finally, reload the privilege tables by typing y.

MariaDB secure-installation prompts removing anonymous users and the test database

Step 8: verify MariaDB access

Confirm your access to MariaDB by typing sudo mariadb and logging in with the root password. Once logged in, type SHOW DATABASES; to display the databases.

MariaDB monitor showing the available databases

Step 9: setup confirmation

This confirms that the setup is successful and operational.

MariaDB monitor confirming the final database check

Frequently asked questions

What are the basic system requirements for setting up this environment?

A Linux-based OS (like Ubuntu), basic user privileges with sudo access, and sufficient storage for PHP, Nginx, and MariaDB installations are essential. A minimum of 1 GB of RAM is recommended to ensure smooth operation of all services.

What should I do if the installation of Nginx or MariaDB fails?

First, ensure that your package list is updated with sudo apt update. If issues persist, check your network connection and try sudo apt upgrade to install any pending system updates. For specific error messages, researching the error code can often lead to a solution.

How do I check if PHP, Nginx, and MariaDB are running correctly?

To check PHP, use php -v to confirm the version. For Nginx, run sudo systemctl status nginx to ensure it’s active. For MariaDB, sudo systemctl status mariadb will show if the service is up. Running these commands verifies that each service has been installed and launched successfully.

Is it necessary to configure the MariaDB security settings, and what do they do?

Yes, configuring MariaDB security is essential for protecting your database from unauthorized access. Running sudo mysql_secure_installation allows you to set a root password, remove anonymous users, restrict root login to the local machine, and remove the test database—all of which enhance database security.

Ready to build a CMS development environment on Virtarix VPS?

Compare VPS sizes for CMS projects, web servers, databases, staging sites, root access, NVMe storage, IPv4 + IPv6, snapshots, and backups.

VPS S

For small websites and landing pages

$ 5 .50 /month
  • 3 cores
  • 6 GB
  • 50 GB NVMe
  • Unlimited
Get It Now
BEST SELLER

VPS M

For growing sites and staging

$ 11 .40 /month
  • 6 cores
  • 16 GB
  • 100 GB NVMe
  • Unlimited
Get It Now
Peter French
About the Author Peter Frenchis the Managing Director at Virtarix, with over 17 years in the tech industry. He has co-founded a cloud storage business, led strategy at a global cloud computing leader, and driven market growth in cybersecurity and data protection.