📁 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.
📦 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
cd /var/www/ wget https://modx.com/download/latest -O modx.zip unzip modx.zip -d modx cd modx/*/ cp -r * /var/www/modxsite/ cd /var/www/ chown -R www-data:www-data modxsite chmod -R 755 modxsite
🌐 Step 5. Configure Virtual Host
sudo nano /etc/apache2/sites-available/modx.conf
ServerName yourdomain.com DocumentRoot /var/www/modxsite AllowOverride All
sudo a2ensite modx sudo a2enmod rewrite sudo systemctl restart 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
If you’re having trouble installing MODX — contact Bit.Hosting support. We’ll help you set everything up! 🚀