How to Install MODX on VPS: Detailed Guide

MODX is a modern CMS and framework suitable for both simple and complex projects. This guide shows how to manually install MODX (Revolution) on a VPS with Ubuntu using LAMP or LEMP stack.

Keep a backup and console access before making changes. Replace example addresses and paths and test commands on a staging system.

Step 1. Prepare the Server

sudo apt update && sudo apt upgrade -y

Step 2. Install LAMP or LEMP Stack

For Apache (LAMP):

sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-cli php-curl php-xml php-mbstring unzip -y

For Nginx (LEMP):

sudo apt install nginx mysql-server php-fpm php-mysql php-cli php-curl php-xml php-mbstring unzip -y

Step 3. Create the Database

sudo mysql -u root -p

CREATE DATABASE modx;
CREATE USER 'modxuser'@'localhost' IDENTIFIED BY 'securepass';
GRANT ALL PRIVILEGES ON modx.* TO 'modxuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4. Download and Install MODX

# Download the traditional ZIP from https://modx.com/download
# Upload it as /root/modx.zip; inspect the archive layout before copying.
STAGE_DIR=$(mktemp -d)
unzip /root/modx.zip -d "$STAGE_DIR"
find "$STAGE_DIR" -maxdepth 3 -name index.php -print
# SOURCE_DIRECTORY must contain index.php, core/, manager/, connectors/, setup/.
# Replace SOURCE_DIRECTORY below with that verified extracted directory.
sudo mkdir -p /var/www/modxsite
sudo cp -a SOURCE_DIRECTORY/. /var/www/modxsite/
sudo chown -R www-data:www-data /var/www/modxsite
sudo find /var/www/modxsite -type d -exec chmod 755 {} +
sudo find /var/www/modxsite -type f -exec chmod 644 {} +

Step 5. Configure Virtual Host

sudo nano /etc/apache2/sites-available/modx.conf
<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/modxsite
    <Directory /var/www/modxsite>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
sudo a2ensite modx
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo systemctl reload apache2

Step 6. Install via Browser

Go to http://yourdomain.com/setup and complete the MODX installation:

  • Choose language and installation type
  • Enter database connection details
  • Create an admin username and password
  • Finish setup and delete the setup folder

Tips from Bit.Hosting

  • Set up HTTPS using Let's Encrypt
  • Only install MODX Extras from trusted sources
  • Use built-in cache and compression
  • For high performance, enable Redis or OPCache
  • Protect the /manager path and configure backups

← Back to “CMS and Websites” section

If you’re having trouble installing MODX — contact Bit.Hosting support. We’ll help you set everything up! 🚀

← CMS and Websites on VPS

Bit.Hosting

Compare plans

Pricing is calculated for the selected billing period.