Skip to main content

Hosting WordPress or Joomla on a Dedicated Server

Hosting WordPress or Joomla on a dedicated server gives you full control over performance, security, and customization. Unlike shared hosting environments, a dedicated server allows you to optimize resources exclusively for your CMS-based website. In this article, we’ll guide you step by step through setting up WordPress or Joomla on a dedicated server running Ubuntu 22.04 LTS. The instructions can be easily adapted for other Linux distributions as needed.

Before you begin, make sure you have a fully configured dedicated server with root or sudo access, a registered domain name pointing to your server’s IP address, and basic knowledge of working in the Linux terminal. With those in place, you’re ready to proceed.

Start by updating your server to ensure all packages are current. Run the command sudo apt update && sudo apt upgrade -y to update the system. Next, we’ll install the LAMP stack—Linux, Apache, MySQL, and PHP—which is required by both WordPress and Joomla to run efficiently.

Begin by installing Apache using sudo apt install apache2 -y. Once installed, proceed to install the MySQL server with sudo apt install mysql-server -y, followed by running sudo mysql_secure_installation to enhance the database server’s security. After securing MySQL, create a new database and user specifically for your CMS. Access the MySQL shell using sudo mysql -u root -p, then create the database and user, grant the necessary privileges, and exit.

Now, install PHP and the required extensions by running a command such as sudo apt install php php-mysql libapache2-mod-php php-cli php-curl php-xml php-gd php-mbstring php-zip unzip -y. These extensions are crucial for the proper functioning of both WordPress and Joomla.

Next, download the CMS you want to use. For WordPress, navigate to /var/www/html and download the latest WordPress package with wget https://wordpress.org/latest.zip. Unzip it and move the contents into the web root directory. For Joomla, use the appropriate download URL (e.g., for version 5.0.2) and follow similar steps to extract and move the files into the web directory.

After placing the CMS files in the correct location, it’s important to set the correct file permissions so the web server can serve them properly. Run sudo chown -R www-data:www-data /var/www/html to assign ownership, and sudo chmod -R 755 /var/www/html to ensure proper access rights.

With the files in place, configure Apache by creating a virtual host file. You can do this by creating a new configuration file in /etc/apache2/sites-available/ with the name of your domain. Define your domain settings in this file, pointing the DocumentRoot to /var/www/html, then enable the site with sudo a2ensite yourdomain.conf and reload Apache.

To secure your site, install a free SSL certificate using Let’s Encrypt. Install Certbot with sudo apt install certbot python3-certbot-apache -y, then run sudo certbot --apache -d yourdomain.com -d www.yourdomain.com to generate and apply your certificate automatically.

Once everything is configured, open your browser and go to your domain. You’ll be presented with the WordPress or Joomla installation wizard. Follow the on-screen instructions to connect to the database you created earlier, set your site title, and create your administrator account.

After installation, it’s recommended to clean up and secure your setup. For Joomla, be sure to delete the installation directory as prompted. You should also set up regular backups, consider using a Web Application Firewall (WAF), and monitor server activity for any unusual behavior.

If you prefer a more user-friendly interface for managing your server and CMS, consider installing a control panel like cPanel, Plesk, or CyberPanel. These tools simplify server management and make it easier to host multiple sites.

By following these steps, you can successfully host WordPress or Joomla on your dedicated server, giving you full control over your website's environment and performance.