{"id":4789,"date":"2018-06-11T17:42:56","date_gmt":"2018-06-11T13:42:56","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/ubuntu-modx\/"},"modified":"2018-06-11T17:42:56","modified_gmt":"2018-06-11T13:42:56","slug":"how-to-install-modx-cms-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-modx-cms-on-ubuntu-18-04-lts\/","title":{"rendered":"How to Install MODX CMS on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>MODX is a free, open source and fast content management system written in PHP language. It is specially designed for ease of use that allows web admin to create powerful and dynamic content websites. MODX comes with a graphical web-based installer, so any normal user can install and build sites of any size.<\/p>\n<p>In this tutorial, we will learn how to install MODX on Ubuntu 18.04 LTS (Bionic Beaver).<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li>A server running Ubuntu 18.04.<\/li>\n<li>A non-root user with sudo privileges.<\/li>\n<\/ul>\n<h2 id=\"install-lamp-server\">Install LAMP Server<\/h2>\n<p>MODX runs on the web server, written in PHP language and uses MariaDB as\u00a0the database, so you will need to install Apache, MariaDB, and PHP to your server. You can install all of them by just running the following command:<\/p>\n<p class=\"command\">sudo apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2-mcrypt php7.2-ldap php7.2-zip php7.2-curl php7.2-sqlite3 -y<\/p>\n<p>Once all the packages are installed, start Apache and MariaDB service and enable them to start on boot using the following command:<\/p>\n<p class=\"command\">sudo systemctl start apache2<br \/>sudo systemctl enable apache2<br \/>sudo systemctl start mariadb<br \/>sudo systemctl enable mariadb<\/p>\n<p>Next, you will need to make some changes in php.ini file:<\/p>\n<p class=\"command\">sudo nano \/etc\/php\/7.2\/apache2\/php.ini<\/p>\n<p>Make the following changes:<\/p>\n<pre>file_uploads = On&#13;\nallow_url_fopen = On&#13;\nmemory_limit = 256M&#13;\nupload_max_file_size = 128M&#13;\nmax_execution_time = 340&#13;\nmax_input_vars = 1500&#13;\n<\/pre>\n<p>Save and close the file, when you are finished.<\/p>\n<h2 id=\"configure-mariadb\">Configure MariaDB<\/h2>\n<p>By default, MariaDB is not secured, so you will need to secure it first. You can do this by running the following command:<\/p>\n<p class=\"command\">sudo mysql_secure_installation<\/p>\n<p>Answer all the questions as shown below:<\/p>\n<pre> Enter current password for root (enter for none): Just press the Enter&#13; Set root password? [Y\/n]: n&#13; Remove anonymous users? [Y\/n]: Y&#13; Disallow root login remotely? [Y\/n]: Y&#13; Remove test database and access to it? [Y\/n]: Y&#13; Reload privilege tables now? [Y\/n]: Y&#13;\n<\/pre>\n<p>Once MariaDB is secured, log in to MariaDB shell:<\/p>\n<p class=\"command\">mysql -u root -p<\/p>\n<p>Enter your root password, then create a database for MODX:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt; CREATE DATABASE modxdb;<\/p>\n<p>Next, create a user for MODX and grant privileges:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt; CREATE USER &#8216;modx&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;password&#8217;;<br \/>MariaDB [(none)]&gt; GRANT ALL ON modxdb.* TO &#8216;modx&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;password&#8217; WITH GRANT OPTION;<\/p>\n<p>Next, flush the privileges with the following command:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt; FLUSH PRIVILEGES;<\/p>\n<p>Finally, exit from the MariaDB shell:<\/p>\n<p class=\"command\">MariaDB [(none)]&gt; exit;<\/p>\n<h2 id=\"install-modx\">Install MODX<\/h2>\n<p>First, you will need to download the latest version of the MODX from their official website. You can download it with the following command:<\/p>\n<p class=\"command\">wget https:\/\/modx.s3.amazonaws.com\/releases\/2.6.3\/modx-2.6.3-pl.zip<\/p>\n<p>Once the download is completed, extract the downloaded file with the following command:<\/p>\n<p class=\"command\">unzip modx-2.6.3-pl.zip<\/p>\n<p>Next, copy the extracted directory to the Apache web root directory:<\/p>\n<p class=\"command\">sudo cp -r modx-2.6.3-pl \/var\/www\/html\/modx<\/p>\n<p>Next, give proper permissions to the modx directory:<\/p>\n<p class=\"command\">sudo chown -R www-data:www-data \/var\/www\/html\/modx<br \/>sudo chmod -R 775 \/var\/www\/html\/modx<\/p>\n<p>Next, you will need to create an apache virtual host directive for MODX.<\/p>\n<p class=\"command\">sudo nano \/etc\/apache2\/sites-available\/modx.conf<\/p>\n<p>Add the following lines:<\/p>\n<pre>&lt;VirtualHost *:80&gt;&#13; ServerAdmin <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"6d0c090004032d08150c001d0108430e0200\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>&#13; DocumentRoot \/var\/www\/html\/modx&#13; ServerName example.com&#13; ServerAlias www.example.com&#13;\n&#13; &lt;Directory \/var\/www\/html\/modx\/&gt;&#13; Options +FollowSymlinks&#13; AllowOverride All&#13; Require all granted&#13; &lt;\/Directory&gt;&#13;\n&#13; ErrorLog ${APACHE_LOG_DIR}\/modx_error.log&#13; CustomLog ${APACHE_LOG_DIR}\/modx_access.log combined&#13;\n&#13;\n&lt;\/VirtualHost&gt;&#13;\n<\/pre>\n<p>Save the file, when you are finished, then enable MODX virtual host file and Apache rewrite module with the following command:<\/p>\n<p class=\"command\">sudo a2ensite modx.conf<br \/>sudo a2enmod rewrite<\/p>\n<p>Finally, restart Apache service using the following command:<\/p>\n<p class=\"command\">sudo systemctl restart apache2<\/p>\n<h2 id=\"access-modx\">Access MODX<\/h2>\n<p>Open your web browser and type the URL <strong>http:\/\/example.com\/setup<\/strong>, you will be redirected to the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts.png\" alt=\"MODX installer\" width=\"550\" height=\"326\" title=\"\"><\/a><\/p>\n<p>Now, select your language and click on the <strong>Select<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-1.png\" alt=\"Welcome to MODX installation program\" width=\"550\" height=\"322\" title=\"\"><\/a><\/p>\n<p>Now, click on the <strong>Next<\/strong> button to start MODX installation, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-2.png\" alt=\"Install options\" width=\"550\" height=\"325\" title=\"\"><\/a><\/p>\n<p>Now, select New Installation option and Click on the <strong>Next<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-3.png\" alt=\"Database connection\" width=\"550\" height=\"325\" title=\"\"><\/a><\/p>\n<p><a class=\"fancybox\" id=\"img-page4_1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page4_1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-4.png\" alt=\"Database connection - part 2\" width=\"550\" height=\"278\" title=\"\"><\/a><\/p>\n<p>Now, Provide your database and admin credential, then click on the <strong>Next<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-5.png\" alt=\"Installation summary\" width=\"550\" height=\"345\" title=\"\"><\/a><\/p>\n<p>Now, click on the <strong>Install<\/strong> button to start the installation, once the installation is completed, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-6.png\" alt=\"Installation completed\" width=\"550\" height=\"307\" title=\"\"><\/a><\/p>\n<p>Now, click on the <strong>Next<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-7.png\" alt=\"MODX Revolution installed\" width=\"550\" height=\"310\" title=\"\"><\/a><\/p>\n<p>Now, click on the <strong>Login<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-8.png\" alt=\"Login to MODX Backend\" width=\"550\" height=\"345\" title=\"\"><\/a><\/p>\n<p>Now, provide your admin login credential and click on the <strong>Login<\/strong> button, you should see the following page:<\/p>\n<p><a class=\"fancybox\" id=\"img-page9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_modx_on_ubuntu_1804\/big\/page9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-9.png\" alt=\"MODX Dashboard\" width=\"550\" height=\"324\" title=\"\"><\/a><\/p>\n<h2 id=\"links\">Links<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-modx%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-10.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-modx%2F&amp;text=How+to+Install+MODX+CMS+on+Ubuntu+18.04+LTS&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-11.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-12.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-modx%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-modx-cms-on-ubuntu-18-04-lts-13.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MODX is a free, open source and fast content management system written in PHP language. It is specially designed for ease of use that allows web admin to create powerful and dynamic content websites. MODX comes with a graphical web-based installer, so any normal user can install and build sites of any size. In this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-4789","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/4789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=4789"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/4789\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=4789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=4789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=4789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}