How to Install MODX Revolution on Ubuntu 20.04
Tags: modxrevolution, ubuntu, linux, cms
Published: 2021-05-31 04:14:18

In this article, we'll explain how to install MODX Revolution on Ubuntu 20.04 with LAMP.

<a href="https://modx.com/" target="_blank" rel="noopener">MODX</a> offers the best qualities of content management systems, web development frameworks, and cloud hosting with less complexity, limitations, and bloat. It’s the Content Management Framework built to help you deliver any digital experience faster, your way, and with improved SEO, security, and speed.
<h4>Prerequisites</h4>
<ul>
 	<li>An Ubuntu 20.04 installed <a href="https://www.hostnextra.com/dedicated-server.html" target="_blank" rel="noopener">dedicated server</a> or <a href="https://www.hostnextra.com/vps-hosting.html" target="_blank" rel="noopener">KVM VPS</a>.</li>
 	<li>A root user access or normal user with administrative privileges.</li>
</ul>
<a href="https://www.hostnextra.com/kb/install-modx-revolution-on-ubuntu/">Install MODX Revolution on Ubuntu 20.04 with LAMP</a>
<h4>1. Keep the server updated</h4>
Update the package repository index, and upgrade the installed packages.
<blockquote># apt update &amp;&amp; sudo apt -y upgrade</blockquote>
<h4>2. Install Apache webserver</h4>
<blockquote># apt install apache2 -y</blockquote>
In case, you enabled firewall and firewall block requests of the apache web server, open a port in the firewall.
<blockquote># ufw allow 80/tcp

# ufw allow 443/tcp

# ufw reload</blockquote>
Start and enable apache2 service.
<blockquote># systemctl start apache2 &amp;&amp; systemctl enable apache2</blockquote>
<h4>3. Install PHP</h4>
Here we are installing the default PHP version 7.4 and other modules for web deployments using the following command:
<blockquote># apt install php libapache2-mod-php php-gd php-mbstring php-common php-mysql php-imagick php-xml -y</blockquote>
<h4>4. Install MariaDB</h4>
<blockquote># apt install mariadb-server mariadb-client -y</blockquote>
The default configuration of the MariaDB will not be secured. Let's secured the installation using the following command:
<blockquote># mysql_secure_installation</blockquote>
Once the script gets executed, it will ask multiple questions.

It will ask you to enter the current password for root (enter for none):

Then enter yes/y to the following security questions:
<blockquote>Set a root password? [Y/n]: y
Remove anonymous users? : y
Disallow root login remotely? : y
Remove test database and access to it? : y
Reload privilege tables now? : y</blockquote>
Login in to mysql
<blockquote># mysql -u root -p</blockquote>
Run the following queries to create a MySQL database and database user for MODX Revolution.
<blockquote>CREATE DATABASE modx_data CHARACTER SET utf8 COLLATE utf8_general_ci;a
CREATE USER 'modx_user'@'localhost' IDENTIFIED BY 'UltraSecurePassword';
GRANT ALL PRIVILEGES ON modx_data.* TO 'modx_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;</blockquote>
<strong>Note:</strong> Replace the database name <em>modx_data</em> and username <em>modx_user</em> with something more to your liking. Replace "<em>UltraSecurePassword</em>" with an actual, secure password.

Install MODX Revolution Files

Change your current working directory to the default web directory.
<blockquote># cd /var/www/html/</blockquote>
Now use wget to download the MODX Revolution installation zip package.
<blockquote># wget https://modx.com/download/direct?id=modx-2.8.3-pl.zip</blockquote>
You should definitely check for the most recent version by visiting the <a href="https://modx.com/download" target="_blank" rel="noopener">MODX Revolution download page</a>.

Give the package a simpler name.
<blockquote># mv direct\?id\=modx-2.8.3-pl.zip modx.zip</blockquote>
Now extract the zip package.
<blockquote># unzip modx.zip</blockquote>
Move all of the installation files to the web root directory.
<blockquote># mv modx-2.8.3-pl/* /var/www/html</blockquote>
Change ownership of the web files to avoid any permissions problems.
<blockquote># chown -R www-data:www-data *</blockquote>
Restart Apache again.
<blockquote># systemctl restart apache2</blockquote>
Now we're ready to move on to the final step.
<h4>5. Setup MODX Revolution Installation</h4>
To access the MODX revolution installation page, enter your server IP address, followed by /setup into your browser address bar.
<blockquote>http://YOUR_VULTR_IP_ADDRESS/setup</blockquote>
<img class="alignnone size-large wp-image-2253" src="https://www.hostnextra.com/kb/wp-content/uploads/2021/05/install-modx-revolution-1024x561.png" alt="Install MODX Revolution" width="700" height="383" />

Click the "<strong><em>Next</em></strong>" button to continue the installation.

Select New Installation and leave the folder permissions at their default values. Click "<strong><em>Next</em></strong>" when you are ready to move on to the next step.

Set the following database options.
<blockquote>Database type: mysql
Database host: localhost
Database login name: modx_user (or your previously selected name)
Database password: UltraSecurePassword (or your previously chosen password)
Database name: modx_data (or your previously selected name)
Table prefix: modx_</blockquote>
Once you have entered the above database options, click on the link below to Test database server connection and view collations. You will see a message that says: Connecting to database server: Success!. If you get any errors, go back and ensure that all database options are correct.

You can leave the character set and collation options at their default values. They should look like this.
<blockquote>Connection character set: utf8
Collation: utf8_general_ci</blockquote>
When you are satisfied with your selected installation options, you can click on the link below to Create or test selection of your database.

You will be prompted to enter your admin details, which will be used to login to the CMS. Fill them in as shown below and click Next.
<blockquote>Administrator name: &lt;your_prefered_admin_name&gt;
Administrator email: &lt;your_admin_email&gt;
Administrator password: &lt;a_secure_password
Confirm password: &lt;the_same_secure_password&gt;</blockquote>
You will see an Installation Summary. As long as everything looks okay, you can simply click Install to Install MODX Revolution to your server instance.

You will see a confirmation page that says Core installation was successful. Simply click <strong><em>Next</em></strong> to continue.

You can now login to your MODX Revolution admin panel using the login details you entered earlier during installation.

<img class="alignnone size-large wp-image-2254" src="https://www.hostnextra.com/kb/wp-content/uploads/2021/05/MODX-Revolution-admin-panel-1024x500.png" alt="MODX Revolution admin panel" width="700" height="342" />

That's it. The installation and setup has been completed successfully.

In this article, we've seen how to install MODX Revolution on Ubuntu 20.04 with LAMP.