ElefantCMS is a free and open-source content management platform that features a user-friendly interface for managing website content effortlessly. Key highlights of this CMS include:
- Built-in WYSIWYG editor that supports dynamic plugins to enhance features.
- Native support for multiple languages with integrated language control tools.
- Streamlined architecture, making it simple for developers to extend core functionalities.
- Variety of mini-apps to accelerate project development.
This guide walks you through the installation of ElefantCMS on a Ubuntu 20.04 server.
Prerequisites
- Deploy an Ubuntu 20.04 server and ensure it is fully updated.
- Create a non-root user with sudo privileges.
Matching infrastructure at centron
Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →
1. Install Necessary Software Packages
Update the System’s Package Index
$ sudo apt updateInstall PHP 7.4 and Additional Modules
$ sudo apt install apache2 mysql-server php7.4 libapache2-mod-php7.4 php7.4-json php7.4-common php7.4-gmp php7.4-curl php7.4-mysql php7.4-opcache php7.4-intl php7.4-fpm php7.4-xmlrpc php7.4-bcmath php7.4-zip php7.4-imagick php7.4-mbstring php7.4-gd php7.4-cli php7.4-xml php7.4-zip wget curl -yModify PHP Configuration Settings
Open the PHP settings file with a text editor:
$ sudo nano /etc/php/7.4/apache2/php.iniUpdate the following parameters. To search inside the file, press Control+W, type the keyword, and press Enter:
memory_limit = 256Mupload_max_filesize = 100Mmax_execution_time = 360date.timezone = Africa/Nairobi
Enable and Restart Apache Web Server
Enable Apache to run at system boot:
$ sudo systemctl enable apache2Apply changes by restarting the Apache service:
$ sudo systemctl restart apache22. Install ElefantCMS on Ubuntu 20.04
Download the Latest ElefantCMS Release
Fetch the current stable build of ElefantCMS. You can always check for the most recent version by visiting the official download page.
$ wget https://github.com/jbroadway/elefant/archive/elefant_2_2_6_stable.tar.gzExtract the Compressed Archive
Unpack the contents of the downloaded archive file:
$ sudo tar -xvzf elefant_2_2_6_stable.tar.gzRename the Project Directory
Change the extracted folder name to something more descriptive:
$ sudo mv elefant-elefant_2_2_6_stable elefantcmsMove ElefantCMS to the Web Server Root
Relocate the renamed directory into Apache’s default web root:
$ sudo mv elefantcms /var/www/html/Clean Up the Installation Files
Delete the compressed file now that it's no longer needed:
$ sudo rm elefant_2_2_6_stable.tar.gzSet File Ownership
Adjust ownership so Apache has proper access to the CMS files:
$ sudo chown -R www-data:www-data /var/www/html/elefantcmsUpdate Directory Permissions
Grant suitable permissions to the directory and its contents:
$ sudo chmod -R 755 /var/www/html/elefantcms3. Create the ElefantCMS MySQL Database
Enable MySQL Service on Boot
Make sure the MySQL service is configured to start automatically with the system:
$ sudo systemctl enable mysqlRun MySQL Secure Installation
Execute the built-in security script to harden your MySQL server against potential threats:
$ sudo mysql_secure_installationAnswer the prompts as follows:
- Set up VALIDATE PASSWORD plugin? Type
Nand press Enter. - Remove anonymous users? Type
Yand press Enter. - Disallow remote root login? Type
Yand press Enter. - Delete test database and related access? Type
Yand press Enter. - Reload privilege tables? Type
Yand press Enter.
Access the MySQL Shell
Log into MySQL using the root user. When prompted, enter the password you configured during the secure installation:
$ sudo mysql -u root -pCreate the ElefantCMS Database
Inside the MySQL shell, create a new database named elefant:
CREATE DATABASE elefant;Create a New MySQL User
Set up a new database user called elefantuser and assign a secure password. Be sure to replace SecurePassword with a strong, unique password:
CREATE USER 'elefantuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SecurePassword';Grant Permissions to the New User
Allow the newly created user full control over the elefant database:
GRANT ALL ON elefant.* TO 'elefantuser'@'localhost' WITH GRANT OPTION;Apply Changes and Exit MySQL
Reload the privilege table to apply the new access rules:
FLUSH PRIVILEGES;Exit the MySQL environment:
exit;4. Configure Apache2 for ElefantCMS
Create a Virtual Host File
Set up a new Apache site configuration by creating a dedicated file named elefantcms.conf:
$ sudo nano /etc/apache2/sites-available/elefantcms.confAdd the following configuration into the file, then save and exit the editor:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/elefantcms
ServerName example.com
<Directory /var/www/html/elefantcms/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>Activate Apache Modules and Configuration
Enable the rewrite module, which is necessary for friendly URLs:
$ sudo a2enmod rewriteEnable the newly created ElefantCMS virtual host configuration:
$ sudo a2ensite elefantcms.confDisable the default Apache virtual host configuration to prevent conflicts:
$ sudo a2dissite 000-default.confAllow Web Traffic Through Port 80
Permit incoming HTTP traffic via UFW:
$ sudo ufw allow 80Restart Apache to Apply Changes
Reboot the Apache service so all the modifications take effect:
$ sudo systemctl restart apache25. Access the ElefantCMS Installer
To begin setting up ElefantCMS, launch your web browser and navigate to:
http://Server_IP/install/
For example:
http://192.0.2.10/install/
Remove the Installation Directory
Once setup is completed through the browser interface, remove the installer directory for security purposes:
$ sudo rm -r /var/www/html/elefantcms/installConclusion
You’ve successfully installed ElefantCMS on your Ubuntu 20.04 server. Proceed by accessing the installation wizard to link your database credentials and set up an administrator account. Once logged in, you're ready to start adding and managing your website content using ElefantCMS’s intuitive interface.
Testen Sie Ihr Setup auf ccloud³
Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.